changeset 6622:a4622f1fb5a1

[gaim-migrate @ 7146] (10:10:23) Robot101: kills off OPT_CONN_* in favour of an enum, and deprecates all the IM_FLAGS_* except IM_FLAG_AWAY which is made into GAIM_IM_AUTO_RESP in a GaimImFlags enum. committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Mon, 25 Aug 2003 14:12:28 +0000
parents 42fdf16f1dad
children 156e6643f9db
files src/connection.h src/conversation.c src/conversation.h src/gtkconv.c src/protocols/gg/gg.c src/protocols/irc/irc.c src/protocols/irc/msgs.c src/protocols/jabber/jabber.c src/protocols/msn/msn.c src/protocols/msn/switchboard.c src/protocols/napster/napster.c src/protocols/oscar/oscar.c src/protocols/toc/toc.c src/protocols/trepia/trepia.c src/protocols/yahoo/yahoo.c src/protocols/zephyr/zephyr.c src/prpl.h src/server.c src/server.h
diffstat 19 files changed, 81 insertions(+), 94 deletions(-) [+]
line wrap: on
line diff
--- a/src/connection.h	Mon Aug 25 02:49:42 2003 +0000
+++ b/src/connection.h	Mon Aug 25 14:12:28 2003 +0000
@@ -30,9 +30,14 @@
 
 typedef struct _GaimConnection GaimConnection;
 
-#define OPT_CONN_HTML		0x00000001
-/* set this flag on a gc if you want serv_got_im to autoreply when away */
-#define OPT_CONN_AUTO_RESP	0x00000002
+/**
+ * Flags to change behavior of the client for a given connection.
+ */
+typedef enum
+{
+	GAIM_CONNECTION_HTML      = 0x0001, /**< Connection sends/receives in 'HTML'. */
+	GAIM_CONNECTION_AUTO_RESP = 0x0002  /**< Send auto responses when away.       */
+} GaimConnectionFlags;
 
 typedef enum
 {
@@ -59,7 +64,7 @@
 struct _GaimConnection
 {
 	GaimPlugin *prpl;            /**< The protocol plugin.               */
-	guint32 flags;               /**< Connection flags.                  */
+	GaimConnectionFlags flags;   /**< Connection flags.                  */
 
 	GaimConnectionState state;   /**< The connection state.              */
 
--- a/src/conversation.c	Mon Aug 25 02:49:42 2003 +0000
+++ b/src/conversation.c	Mon Aug 25 14:12:28 2003 +0000
@@ -218,7 +218,7 @@
 
 	buf2 = g_malloc(limit);
 
-	if ((gc->flags & OPT_CONN_HTML) &&
+	if ((gc->flags & GAIM_CONNECTION_HTML) &&
 		gaim_prefs_get_bool("/core/conversations/send_urls_as_links")) {
 
 		buffy = linkify_text(buf);
--- a/src/conversation.h	Mon Aug 25 02:49:42 2003 +0000
+++ b/src/conversation.h	Mon Aug 25 14:12:28 2003 +0000
@@ -102,14 +102,14 @@
  */
 typedef enum
 {
-	GAIM_MESSAGE_SEND = 0x01,      /**< Outgoing message.     */
-	GAIM_MESSAGE_RECV = 0x02,      /**< Incoming message.     */
-	GAIM_MESSAGE_SYSTEM = 0x04,    /**< System message.       */
-	GAIM_MESSAGE_AUTO_RESP = 0x08, /**< Auto response.        */
-	GAIM_MESSAGE_COLORIZE = 0x10,  /**< Colorize nicks.       */
-	GAIM_MESSAGE_NICK = 0x20,      /**< Contains your nick.   */
-	GAIM_MESSAGE_NO_LOG = 0x40,    /**< Do not log.           */
-	GAIM_MESSAGE_WHISPER = 0x80    /**< Whispered message.    */
+	GAIM_MESSAGE_SEND      = 0x0001, /**< Outgoing message.     */
+	GAIM_MESSAGE_RECV      = 0x0002, /**< Incoming message.     */
+	GAIM_MESSAGE_SYSTEM    = 0x0004, /**< System message.       */
+	GAIM_MESSAGE_AUTO_RESP = 0x0008, /**< Auto response.        */
+	GAIM_MESSAGE_COLORIZE  = 0x0010, /**< Colorize nicks.       */
+	GAIM_MESSAGE_NICK      = 0x0020, /**< Contains your nick.   */
+	GAIM_MESSAGE_NO_LOG    = 0x0040, /**< Do not log.           */
+	GAIM_MESSAGE_WHISPER   = 0x0080  /**< Whispered message.    */
 } GaimMessageFlags;
 
 #include "account.h"
--- a/src/gtkconv.c	Mon Aug 25 02:49:42 2003 +0000
+++ b/src/gtkconv.c	Mon Aug 25 14:12:28 2003 +0000
@@ -381,7 +381,7 @@
 
 	buf2 = g_malloc(limit);
 
-	if (gc && gc->flags & OPT_CONN_HTML) {
+	if (gc && gc->flags & GAIM_CONNECTION_HTML) {
 		if (gaim_prefs_get_bool("/gaim/gtk/conversations/send_bold")) {
 			g_snprintf(buf2, limit, "<B>%s</B>", buf);
 			strcpy(buf, buf2);
--- a/src/protocols/gg/gg.c	Mon Aug 25 02:49:42 2003 +0000
+++ b/src/protocols/gg/gg.c	Mon Aug 25 14:12:28 2003 +0000
@@ -1,6 +1,6 @@
 /*
  * gaim - Gadu-Gadu Protocol Plugin
- * $Id: gg.c 6876 2003-08-05 10:55:04Z chipx86 $
+ * $Id: gg.c 7146 2003-08-25 14:12:28Z lschiere $
  *
  * Copyright (C) 2001 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL>
  * 
@@ -560,7 +560,7 @@
 	g_free(gc->proto_data);
 }
 
-static int agg_send_im(GaimConnection *gc, const char *who, const char *msg, int len, int flags)
+static int agg_send_im(GaimConnection *gc, const char *who, const char *msg, int len, GaimImFlags flags)
 {
 	struct agg_data *gd = (struct agg_data *)gc->proto_data;
 	gchar *imsg;
@@ -574,8 +574,7 @@
 
 	if (strlen(msg) > 0) {
 		imsg = charset_convert(msg, "UTF-8", "CP1250");
-		if (gg_send_message(gd->sess, (flags & IM_FLAG_CHECKBOX)
-				    ? GG_CLASS_MSG : GG_CLASS_CHAT,
+		if (gg_send_message(gd->sess, GG_CLASS_CHAT,
 				    strtol(who, (char **)NULL, 10), imsg) < 0)
 			return -1;
 		g_free(imsg);
--- a/src/protocols/irc/irc.c	Mon Aug 25 02:49:42 2003 +0000
+++ b/src/protocols/irc/irc.c	Mon Aug 25 14:12:28 2003 +0000
@@ -43,7 +43,7 @@
 static void irc_login(GaimAccount *account);
 static void irc_login_cb(gpointer data, gint source, GaimInputCondition cond);
 static void irc_close(GaimConnection *gc);
-static int irc_im_send(GaimConnection *gc, const char *who, const char *what, int len, int flags);
+static int irc_im_send(GaimConnection *gc, const char *who, const char *what, int len, GaimImFlags flags);
 static int irc_chat_send(GaimConnection *gc, int id, const char *what);
 static void irc_chat_join (GaimConnection *gc, GHashTable *data);
 static void irc_input_cb(gpointer data, gint source, GaimInputCondition cond);
@@ -237,7 +237,7 @@
 	g_free(irc);
 }
 
-static int irc_im_send(GaimConnection *gc, const char *who, const char *what, int len, int flags)
+static int irc_im_send(GaimConnection *gc, const char *who, const char *what, int len, GaimImFlags flags)
 {
 	struct irc_conn *irc = gc->proto_data;
 	const char *args[2];
--- a/src/protocols/irc/msgs.c	Mon Aug 25 02:49:42 2003 +0000
+++ b/src/protocols/irc/msgs.c	Mon Aug 25 14:12:28 2003 +0000
@@ -88,7 +88,7 @@
 
 	gc = gaim_account_get_connection(irc->account);
 	if (gc)
-		serv_got_im(gc, args[1], args[2], IM_FLAG_AWAY, time(NULL), -1);
+		serv_got_im(gc, args[1], args[2], GAIM_IM_AUTO_RESP, time(NULL), -1);
 }
 
 void irc_msg_badmode(struct irc_conn *irc, const char *name, const char *from, char **args)
--- a/src/protocols/jabber/jabber.c	Mon Aug 25 02:49:42 2003 +0000
+++ b/src/protocols/jabber/jabber.c	Mon Aug 25 14:12:28 2003 +0000
@@ -2359,7 +2359,7 @@
 	struct jabber_data *jd = gc->proto_data = g_new0(struct jabber_data, 1);
 	char *loginname = create_valid_jid(account->username, DEFAULT_SERVER, "Gaim");
 
-	gc->flags |= OPT_CONN_HTML;
+	gc->flags |= GAIM_CONNECTION_HTML;
 
 	jd->buddies = g_hash_table_new(g_str_hash, g_str_equal);
 	jd->chats = NULL;	/* we have no chats yet */
@@ -2515,7 +2515,7 @@
 	g_free(xhtml);
 }
 
-static int jabber_send_im(GaimConnection *gc, const char *who, const char *message, int len, int flags)
+static int jabber_send_im(GaimConnection *gc, const char *who, const char *message, int len, GaimImFlags flags)
 {
 	xmlnode x, y;
 	char *thread_id = NULL;
--- a/src/protocols/msn/msn.c	Mon Aug 25 02:49:42 2003 +0000
+++ b/src/protocols/msn/msn.c	Mon Aug 25 14:12:28 2003 +0000
@@ -476,7 +476,7 @@
 
 static int
 msn_send_im(GaimConnection *gc, const char *who, const char *message,
-			int len, int flags)
+			int len, GaimImFlags flags)
 {
 	GaimAccount *account = gaim_connection_get_account(gc);
 	MsnSession *session = gc->proto_data;
@@ -522,7 +522,7 @@
 		 * we'll fake like we received it ;)
 		 */
 		serv_got_typing_stopped(gc, (char *)who);
-		serv_got_im(gc, who, message, flags | IM_FLAG_GAIMUSER,
+		serv_got_im(gc, who, message, flags,
 					time(NULL), -1);
 	}
 
--- a/src/protocols/msn/switchboard.c	Mon Aug 25 02:49:42 2003 +0000
+++ b/src/protocols/msn/switchboard.c	Mon Aug 25 14:12:28 2003 +0000
@@ -293,7 +293,6 @@
 	MsnSwitchBoard *swboard = servconn->data;
 	char *body;
 	const char *value;
-	int flags = 0;
 
 	body = g_strdup(msn_message_get_body(msg));
 
@@ -301,10 +300,6 @@
 
 	if ((value = msn_message_get_attr(msg, "User-Agent")) != NULL) {
 		gaim_debug(GAIM_DEBUG_MISC, "msn", "value = '%s'\n", value);
-		if (!g_ascii_strncasecmp(value, "Gaim", 4)) {
-			gaim_debug(GAIM_DEBUG_INFO, "msn", "Setting GAIMUSER flag.\n");
-			flags |= IM_FLAG_GAIMUSER;
-		}
 	}
 
 	if ((value = msn_message_get_attr(msg, "X-MMS-IM-Format")) != NULL) {
@@ -322,7 +317,7 @@
 		serv_got_chat_in(gc, gaim_chat_get_id(GAIM_CHAT(swboard->chat)),
 						 servconn->msg_passport, 0, body, time(NULL));
 	else
-		serv_got_im(gc, servconn->msg_passport, body, flags, time(NULL), -1);
+		serv_got_im(gc, servconn->msg_passport, body, 0, time(NULL), -1);
 
 	g_free(body);
 
--- a/src/protocols/napster/napster.c	Mon Aug 25 02:49:42 2003 +0000
+++ b/src/protocols/napster/napster.c	Mon Aug 25 14:12:28 2003 +0000
@@ -129,7 +129,7 @@
 }
 
 /* 205 - MSG_CLIENT_PRIVMSG */
-static int nap_send_im(GaimConnection *gc, const char *who, const char *message, int len, int flags)
+static int nap_send_im(GaimConnection *gc, const char *who, const char *message, int len, GaimImFlags flags)
 {
 
 	if ((strlen(message) < 2) || (message[0] != '/' ) || (message[1] == '/')) {
--- a/src/protocols/oscar/oscar.c	Mon Aug 25 02:49:42 2003 +0000
+++ b/src/protocols/oscar/oscar.c	Mon Aug 25 14:12:28 2003 +0000
@@ -656,8 +656,8 @@
 	if (isdigit(*(gaim_account_get_username(account)))) {
 		od->icq = TRUE;
 	} else {
-		gc->flags |= OPT_CONN_HTML;
-		gc->flags |= OPT_CONN_AUTO_RESP;
+		gc->flags |= GAIM_CONNECTION_HTML;
+		gc->flags |= GAIM_CONNECTION_AUTO_RESP;
 	}
 	od->buddyinfo = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, oscar_free_buddyinfo);
 
@@ -2163,7 +2163,7 @@
 	GaimConnection *gc = sess->aux_data;
 	struct oscar_data *od = gc->proto_data;
 	char *tmp;
-	int flags = 0;
+	GaimImFlags flags = 0;
 	gsize convlen;
 	GError *err = NULL;
 	struct buddyinfo *bi;
@@ -2176,7 +2176,7 @@
 	}
 
 	if (args->icbmflags & AIM_IMFLAGS_AWAY)
-		flags |= IM_FLAG_AWAY;
+		flags |= GAIM_IM_AUTO_RESP;
 
 	if (args->icbmflags & AIM_IMFLAGS_TYPINGNOT)
 		bi->typingnot = TRUE;
@@ -4259,7 +4259,7 @@
 }
 static void oscar_ask_direct_im(GaimConnection *gc, const char *name);
 
-static int oscar_send_im(GaimConnection *gc, const char *name, const char *message, int len, int imflags) {
+static int oscar_send_im(GaimConnection *gc, const char *name, const char *message, int len, GaimImFlags imflags) {
 	struct oscar_data *od = (struct oscar_data *)gc->proto_data;
 	struct direct_im *dim = find_direct_im(od, name);
 	int ret = 0;
@@ -4270,7 +4270,7 @@
 	if (dim && dim->connected) {
 		/* If we're directly connected, send a direct IM */
 		/* XXX - The last parameter below is the encoding.  Let Paco-Paco do something with it. */
-		if (imflags & IM_FLAG_AWAY)
+		if (imflags & GAIM_IM_AUTO_RESP)
 			ret =  aim_odc_send_im(od->sess, dim->conn, message, len == -1 ? strlen(message) : len, 0, 1);
 		else
 			ret =  aim_odc_send_im(od->sess, dim->conn, message, len == -1 ? strlen(message) : len, 0, 0);
@@ -4299,7 +4299,7 @@
 			args.features = features_aim;
 			args.featureslen = sizeof(features_aim);
 
-			if (imflags & IM_FLAG_AWAY)
+			if (imflags & GAIM_IM_AUTO_RESP)
 				args.flags |= AIM_IMFLAGS_AWAY;
 		}
 
@@ -5633,7 +5633,7 @@
 
 static int gaim_odc_incoming(aim_session_t *sess, aim_frame_t *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
-	int imflags = 0;
+	GaimImFlags imflags = 0;
 	va_list ap;
 	char *sn, *msg;
 	int len, encoding, isawaymsg;
@@ -5650,7 +5650,7 @@
 			   "Got DirectIM message from %s\n", sn);
 
 	if (isawaymsg)
-		imflags |= IM_FLAG_AWAY;
+		imflags |= GAIM_IM_AUTO_RESP;
 
 	/* XXX - I imagine Paco-Paco will want to do some voodoo with the encoding here */
 	serv_got_im(gc, sn, msg, imflags, time(NULL), len);
--- a/src/protocols/toc/toc.c	Mon Aug 25 02:49:42 2003 +0000
+++ b/src/protocols/toc/toc.c	Mon Aug 25 14:12:28 2003 +0000
@@ -169,8 +169,8 @@
 
 	gc = gaim_account_get_connection(account);
 	gc->proto_data = tdt = g_new0(struct toc_data, 1);
-	gc->flags |= OPT_CONN_HTML;
-	gc->flags |= OPT_CONN_AUTO_RESP;
+	gc->flags |= GAIM_CONNECTION_HTML;
+	gc->flags |= GAIM_CONNECTION_AUTO_RESP;
 
 	g_snprintf(buf, sizeof buf, _("Looking up %s"),
 			gaim_account_get_string(account, "server", TOC_HOST));
@@ -737,7 +737,7 @@
 			message++;
 		message++;
 
-		a = (away && (*away == 'T')) ? IM_FLAG_AWAY : 0;
+		a = (away && (*away == 'T')) ? GAIM_IM_AUTO_RESP : 0;
 
 		serv_got_im(gc, c, message, a, time(NULL), -1);
 	} else if (!g_ascii_strcasecmp(c, "UPDATE_BUDDY")) {
@@ -1058,7 +1058,7 @@
 	}
 }
 
-static int toc_send_im(GaimConnection *gc, const char *name, const char *message, int len, int flags)
+static int toc_send_im(GaimConnection *gc, const char *name, const char *message, int len, GaimImFlags flags)
 {
 	char *buf1, *buf2;
 
@@ -1071,7 +1071,7 @@
 
 gaim_debug(GAIM_DEBUG_ERROR, "xxx", "1 - Sending message %s\n", buf1);
 	buf2 = g_strdup_printf("toc_send_im %s \"%s\"%s", normalize(name), buf1, 
-						   ((flags & IM_FLAG_AWAY) ? " auto" : ""));
+						   ((flags & GAIM_IM_AUTO_RESP) ? " auto" : ""));
 	g_free(buf1);
 gaim_debug(GAIM_DEBUG_ERROR, "xxx", "1 - Sending message %s\n", buf2);
 	sflap_send(gc, buf2, -1, TYPE_DATA);
--- a/src/protocols/trepia/trepia.c	Mon Aug 25 02:49:42 2003 +0000
+++ b/src/protocols/trepia/trepia.c	Mon Aug 25 14:12:28 2003 +0000
@@ -1174,7 +1174,7 @@
 
 static int
 trepia_send_im(GaimConnection *gc, const char *who, const char *message,
-			int len, int flags)
+			int len, GaimImFlags flags)
 {
 	TrepiaSession *session = gc->proto_data;
 	TrepiaProfile *profile;
--- a/src/protocols/yahoo/yahoo.c	Mon Aug 25 02:49:42 2003 +0000
+++ b/src/protocols/yahoo/yahoo.c	Mon Aug 25 14:12:28 2003 +0000
@@ -1193,7 +1193,7 @@
 	return m;
 }
 
-static int yahoo_send_im(GaimConnection *gc, const char *who, const char *what, int len, int flags)
+static int yahoo_send_im(GaimConnection *gc, const char *who, const char *what, int len, GaimImFlags flags)
 {
 	struct yahoo_data *yd = gc->proto_data;
 	struct yahoo_packet *pkt = yahoo_packet_new(YAHOO_SERVICE_MESSAGE, YAHOO_STATUS_OFFLINE, 0);
--- a/src/protocols/zephyr/zephyr.c	Mon Aug 25 02:49:42 2003 +0000
+++ b/src/protocols/zephyr/zephyr.c	Mon Aug 25 14:12:28 2003 +0000
@@ -358,7 +358,7 @@
 		char *sendertmp;
 		char *ptr = notice.z_message + strlen(notice.z_message) + 1;
 		int len = notice.z_message_len - (ptr - notice.z_message);
-		int away;
+		GaimImFlags flags;
 		if (len > 0) {
 			buf = g_malloc(len + 1);
 			g_snprintf(buf, len + 1, "%s", ptr);
@@ -368,10 +368,8 @@
 			if (!g_ascii_strcasecmp(notice.z_class, "MESSAGE") &&
                             !g_ascii_strcasecmp(notice.z_class_inst, "PERSONAL")) {
 				if (!g_ascii_strcasecmp(notice.z_message, "Automated reply:"))
-					away = TRUE;
-				else
-					away = FALSE;
-				serv_got_im(zgc, notice.z_sender, buf2, 0, time(NULL), -1);
+					flags |= GAIM_IM_AUTO_RESP;
+				serv_got_im(zgc, notice.z_sender, buf2, flags, time(NULL), -1);
 			} else {
 				zephyr_triple *zt1, *zt2;
 				zt1 = new_triple(notice.z_class, notice.z_class_inst,
@@ -783,12 +781,12 @@
 	return 0;
 }
 
-static int zephyr_send_im(GaimConnection *gc, const char *who, const char *im, int len, int flags) {
+static int zephyr_send_im(GaimConnection *gc, const char *who, const char *im, int len, GaimImFlags flags) {
 	ZNotice_t notice;
 	char *buf;
 	const char *sig;
 
-	if (flags & IM_FLAG_AWAY)
+	if (flags & GAIM_IM_AUTO_RESP)
 		sig = "Automated reply:";
 	else {
 		sig = ZGetVariable("zwrite-signature");
--- a/src/prpl.h	Mon Aug 25 02:49:42 2003 +0000
+++ b/src/prpl.h	Mon Aug 25 14:12:28 2003 +0000
@@ -87,6 +87,14 @@
 /*@}*/
 
 /**
+ * Flags applicable to outgoing/incoming IMs from prpls.
+ */
+typedef enum
+{
+	GAIM_IM_AUTO_RESP = 0x01,    /**< Auto response.    */
+} GaimImFlags;
+
+/**
  * Protocol options
  *
  * These should all be stuff that some plugins can do and others can't.
@@ -232,7 +240,8 @@
 	void (*login)(GaimAccount *);
 	void (*close)(GaimConnection *);
 	int  (*send_im)(GaimConnection *, const char *who,
-					const char *message, int len, int away);
+					const char *message, int len,
+					GaimImFlags flags);
 	void (*set_info)(GaimConnection *, const char *info);
 	int  (*send_typing)(GaimConnection *, const char *name, int typing);
 	void (*get_info)(GaimConnection *, const char *who);
--- a/src/server.c	Mon Aug 25 02:49:42 2003 +0000
+++ b/src/server.c	Mon Aug 25 14:12:28 2003 +0000
@@ -258,7 +258,7 @@
 }
 
 int serv_send_im(GaimConnection *gc, const char *name, const char *message,
-				 int len, int imflags)
+				 int len, GaimImFlags imflags)
 {
 	GaimConversation *c;
 	int val = -EINVAL;
@@ -272,11 +272,11 @@
 	if (prpl_info && prpl_info->send_im)
 		val = prpl_info->send_im(gc, name, message, len, imflags);
 
-	if (!(imflags & IM_FLAG_AWAY))
+	if (!(imflags & GAIM_MESSAGE_AUTO_RESP))
 		serv_touch_idle(gc);
 
 	if (gc->away &&
-		(gc->flags & OPT_CONN_AUTO_RESP) &&
+		(gc->flags & GAIM_CONNECTION_AUTO_RESP) &&
 		gaim_prefs_get_bool("/core/away/auto_response/enabled") &&
 		!gaim_prefs_get_bool("/core/away/auto_response/in_active_conv")) {
 
@@ -813,30 +813,13 @@
  * sure to follow along, kids
  */
 void serv_got_im(GaimConnection *gc, const char *who, const char *msg,
-				 guint32 imflags, time_t mtime, gint len)
+				 GaimImFlags imflags, time_t mtime, gint len)
 {
-	char *buffy;
-	char *angel;
-	int plugin_return;
-	GaimMessageFlags away = 0;
-
 	GaimConversation *cnv;
-
+	GaimMessageFlags auto_resp;
 	char *message, *name;
-
-	/*
-	 * Pay no attention to the man behind the curtain.
-	 *
-	 * The reason i feel okay with this is because it's useful to some
-	 * plugins. Gaim doesn't ever use it itself. Besides, it's not entirely
-	 * accurate; it's possible to have false negatives with most protocols.
-	 * Also with some it's easy to have false positives as well. So if you're
-	 * a plugin author, don't rely on this, still do your own checks. But uh.
-	 * It's a start.
-	 */
-
-	if (imflags & IM_FLAG_GAIMUSER)
-		gaim_debug(GAIM_DEBUG_MISC, "server", "%s is a gaim user.\n", who);
+	char *angel, *buffy;
+	int plugin_return;
 
 	/*
 	 * We should update the conversation window buttons and menu,
@@ -893,8 +876,10 @@
 	 * was an auto-response, we set the appropriate flag. This is just so
 	 * prpls don't have to know about GAIM_MESSAGE_* (though some do anyway)
 	 */
-	if (imflags & IM_FLAG_AWAY)
-		away = GAIM_MESSAGE_AUTO_RESP;
+	if (imflags & GAIM_IM_AUTO_RESP)
+		auto_resp = GAIM_MESSAGE_AUTO_RESP;
+	else
+		auto_resp = 0;
 
 	/*
 	 * Alright. Two cases for how to handle this. Either we're away or
@@ -936,7 +921,7 @@
 			qm->message = g_memdup(message, len == -1 ? strlen(message) + 1 : len);
 			qm->account = gc->account;
 			qm->tm = mtime;
-			qm->flags = GAIM_MESSAGE_RECV | away;
+			qm->flags = GAIM_MESSAGE_RECV | auto_resp;
 			qm->len = len;
 			message_queue = g_slist_append(message_queue, qm);
 
@@ -973,7 +958,7 @@
 				cnv = gaim_conversation_new(GAIM_CONV_IM, gc->account, name);
 
 			gaim_im_write(GAIM_IM(cnv), NULL, message, len,
-						  away | GAIM_MESSAGE_RECV, mtime);
+						  GAIM_MESSAGE_RECV | auto_resp, mtime);
 		}
 
 		/*
@@ -987,7 +972,7 @@
 		 *  - or we're not idle and the 'only auto respond if idle' pref
 		 *    is set
 		 */
-		if (!(gc->flags & OPT_CONN_AUTO_RESP) ||
+		if (!(gc->flags & GAIM_CONNECTION_AUTO_RESP) ||
 			!gaim_prefs_get_bool("/core/away/auto_response/enabled") ||
 			*gc->away == '\0' ||
 			(!gc->is_idle &&
@@ -1019,7 +1004,7 @@
 
 		/* apply default fonts and colors */
 		tmpmsg = stylize(gc->away, MSG_LEN);
-		serv_send_im(gc, name, away_subs(tmpmsg, alias), -1, IM_FLAG_AWAY);
+		serv_send_im(gc, name, away_subs(tmpmsg, alias), -1, GAIM_IM_AUTO_RESP);
 		if (!cnv && awayqueue &&
 			gaim_prefs_get_bool("/gaim/gtk/away/queue_messages")) {
 
@@ -1063,7 +1048,7 @@
 			qm->message = g_strdup(message);
 			qm->account = gc->account;
 			qm->tm = mtime;
-			qm->flags = away | GAIM_MESSAGE_RECV;
+			qm->flags = GAIM_MESSAGE_RECV | auto_resp;
 			qm->len = len;
 			unread_message_queue = g_slist_append(unread_message_queue, qm);
 		}
@@ -1072,7 +1057,7 @@
 				cnv = gaim_conversation_new(GAIM_CONV_IM, gc->account, name);
 
 			gaim_im_write(GAIM_IM(cnv), NULL, message, len,
-						  away | GAIM_MESSAGE_RECV, mtime);
+						  GAIM_MESSAGE_RECV | auto_resp, mtime);
 			gaim_window_flash(gaim_conversation_get_window(cnv));
 		}
 	}
--- a/src/server.h	Mon Aug 25 02:49:42 2003 +0000
+++ b/src/server.h	Mon Aug 25 14:12:28 2003 +0000
@@ -23,10 +23,6 @@
 #ifndef _GAIM_SERVER_H_
 #define _GAIM_SERVER_H_
 
-#define IM_FLAG_AWAY     0x01
-#define IM_FLAG_CHECKBOX 0x02
-#define IM_FLAG_GAIMUSER 0x04
-
 /*
  * Really user states are controlled by the PRPLs now. We just
  * use this for event_away
@@ -43,7 +39,7 @@
 void serv_login(GaimAccount *);
 void serv_close(GaimConnection *);
 void serv_touch_idle(GaimConnection *);
-int  serv_send_im(GaimConnection *, const char *, const char *, int, int);
+int  serv_send_im(GaimConnection *, const char *, const char *, int, GaimImFlags);
 void serv_get_info(GaimConnection *, const char *);
 void serv_get_dir(GaimConnection *, const char *);
 void serv_set_idle(GaimConnection *, int);
@@ -85,7 +81,7 @@
 void serv_set_buddyicon(GaimConnection *gc, const char *filename);
 void serv_got_typing_stopped(GaimConnection *gc, const char *name);
 void serv_got_im(GaimConnection *gc, const char *who, const char *msg,
-				 guint32 flags, time_t mtime, gint len);
+				 GaimImFlags imflags, time_t mtime, gint len);
 void serv_got_update(GaimConnection *gc, const char *name, int loggedin,
 					 int evil, time_t signon, time_t idle, int type);
 void serv_finish_login(GaimConnection *gc);