diff src/protocols/sametime/sametime.c @ 11536:16796e09b9c1

[gaim-migrate @ 13790] GaimBuddy->uc is gone! at last! (it survived probably > 5 years). You'll want to make sure any plugins that make use of GaimBuddy in any way are recompiled, otherwise you'll have el-bizarro crashes. You probably want to make sure you make clean && make && make install too. Maybe reformatting your hard disk to remove any references to uc would be a good idea too. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Wed, 14 Sep 2005 00:54:21 +0000
parents c9b815aeddc1
children 726264a8f48f
line wrap: on
line diff
--- a/src/protocols/sametime/sametime.c	Tue Sep 13 21:14:58 2005 +0000
+++ b/src/protocols/sametime/sametime.c	Wed Sep 14 00:54:21 2005 +0000
@@ -2606,15 +2606,16 @@
 static void mw_prpl_list_emblems(GaimBuddy *b,
 				 const char **se, const char **sw,
 				 const char **nw, const char **ne) {
-
-  /* we have to add the UC_UNAVAILABLE flag so that Gaim will recognie
-     certain away states as indicating the buddy is unavailable */
+  GaimPresence *presence = gaim_buddy_get_presence(b);
+  GaimStatus *status = gaim_presence_get_active_status(presence);
 
   if(! GAIM_BUDDY_IS_ONLINE(b)) {
     *se = "offline";
-  } else if(b->uc == (mwStatus_AWAY /* XXX | UC_UNAVAILABLE */)) {
+  } else if(!gaim_presence_is_available(presence) &&
+            !strcmp(gaim_status_get_id(status), MW_STATE_AWAY)) {
     *se = "away";
-  } else if(b->uc == (mwStatus_BUSY /* XXX | UC_UNAVAILABLE */)) {
+  } else if(!gaim_presence_is_available(presence) &&
+            !strcmp(gaim_status_get_id(status), MW_STATE_BUSY)) {
     *se = "dnd";
   }
 }
@@ -2635,6 +2636,15 @@
 
 
 static const char *status_text(GaimBuddy *b) {
+  GaimPresence *presence = gaim_buddy_get_presence(b);
+  GaimStatus *status = gaim_presence_get_active_status(presence);
+
+  return gaim_status_get_name(status);
+
+  /* I left this here in case it's more accurate than the status name.
+   * Stu. */
+#if 0
+
   guint status = b->uc;
 
   if(! GAIM_BUDDY_IS_ONLINE(b) ) {
@@ -2655,6 +2665,7 @@
   } else {
     return MW_STATE_UNKNOWN;
   }
+#endif
 }