diff src/protocols/sametime/sametime.c @ 12263:8190a70d2c34

[gaim-migrate @ 14565] removed GMP dependancy for sametime support. fixed some buddy status issues as noted in bug #1368136. sametime seems to be working just fine now, and I'm trying to use HEAD as my primary client for a while to get things going. committer: Tailor Script <tailor@pidgin.im>
author Christopher O'Brien <siege@pidgin.im>
date Tue, 29 Nov 2005 23:37:05 +0000
parents 4d3119205a33
children 0e467757b57a
line wrap: on
line diff
--- a/src/protocols/sametime/sametime.c	Tue Nov 29 23:34:19 2005 +0000
+++ b/src/protocols/sametime/sametime.c	Tue Nov 29 23:37:05 2005 +0000
@@ -501,8 +501,13 @@
     gaim_blist_node_set_int(bnode, BUDDY_KEY_TYPE, mwSametimeUser_NORMAL);
   }
   
-  gaim_prpl_got_user_status(acct, id, status, NULL);
-  gaim_prpl_got_user_idle(acct, id, !!idle, idle);
+  if(aware->online) {
+    gaim_prpl_got_user_status(acct, id, status, NULL);
+    gaim_prpl_got_user_idle(acct, id, !!idle, idle);
+
+  } else {
+    gaim_prpl_got_user_status(acct, id, MW_STATE_OFFLINE, NULL);
+  }
 }
 
 
@@ -1682,8 +1687,8 @@
   GaimAccount *acct;
   GaimConversation *conv;
   GaimBuddy *buddy;
-  const char *who = from->user_id;
-  char *tmp, *msg;
+  char *who = from->user_id;
+  char *msg;
   
   pd = mwSession_getClientData(s);
   acct = gaim_connection_get_account(pd->gc);
@@ -1691,15 +1696,13 @@
   if(! conv) conv = gaim_conversation_new(GAIM_CONV_TYPE_IM, acct, who);
 
   buddy = gaim_find_buddy(acct, who);
-  if(buddy) {
-    who = gaim_buddy_get_contact_alias(buddy);
-  }
-
-  tmp = g_strdup_printf(_("Announcement from %s"), who);
+  if(buddy) who = (char *) gaim_buddy_get_contact_alias(buddy);
+
+  who = g_strdup_printf(_("Announcement from %s"), who);
   msg = gaim_markup_linkify(text);
 
-  gaim_conversation_write(conv, tmp, msg, GAIM_MESSAGE_RECV, time(NULL));
-  g_free(tmp);
+  gaim_conversation_write(conv, who, msg, GAIM_MESSAGE_RECV, time(NULL));
+  g_free(who);
   g_free(msg);
 }