changeset 12981:880844bef520

[gaim-migrate @ 15334] Don't auto-reply when we're invisible, either committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 21 Jan 2006 22:33:12 +0000
parents b7fd4315ab79
children 614ab5ffc6f9
files src/server.c
diffstat 1 files changed, 11 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/server.c	Sat Jan 21 21:34:28 2006 +0000
+++ b/src/server.c	Sat Jan 21 22:33:12 2006 +0000
@@ -432,8 +432,6 @@
 {
 	GaimAccount *account;
 	GaimConversation *cnv;
-	GaimPresence *presence;
-	GaimStatus *status;
 	char *message, *name;
 	char *angel, *buffy;
 	int plugin_return;
@@ -448,8 +446,6 @@
 			return;
 	}
 
-	presence = gaim_account_get_presence(account);
-
 	/*
 	 * We should update the conversation window buttons and menu,
 	 * if it exists.
@@ -515,16 +511,24 @@
 	 */
 	if (gc->flags & GAIM_CONNECTION_AUTO_RESP)
 	{
+		GaimPresence *presence;
+		GaimStatus *status;
+		GaimStatusType *status_type;
+		GaimStatusPrimitive primitive;
 		const gchar *auto_reply_pref;
 		const char *away_msg = NULL;
 
 		auto_reply_pref = gaim_prefs_get_string("/core/away/auto_reply");
 
+		presence = gaim_account_get_presence(account);
 		status = gaim_presence_get_active_status(presence);
-		if (gaim_status_is_available(status) ||
+		status_type = gaim_status_get_type(status);
+		primitive = gaim_status_type_get_primitive(status_type);
+		if ((primitive == GAIM_STATUS_AVAILABLE) ||
+			(primitive == GAIM_STATUS_INVISIBLE) ||
+			(primitive == GAIM_STATUS_MOBILE) ||
 		    !strcmp(auto_reply_pref, "never") ||
-		    (!gaim_presence_is_idle(presence) &&
-		     !strcmp(auto_reply_pref, "awayidle")))
+		    (!gaim_presence_is_idle(presence) && !strcmp(auto_reply_pref, "awayidle")))
 		{
 			g_free(name);
 			return;