diff libpurple/protocols/jabber/buddy.c @ 28132:eb2d17945ce3

jabber: Store the "own JabberBuddy" in the JabberStream* struct. This simplifies the roster code a little (don't need to recalculate our own JID for string comparisons) and fixes a few FIXMEs in buddy.c.
author Paul Aurich <paul@darkrain42.org>
date Sat, 01 Aug 2009 22:12:30 +0000
parents 1ea1aee71848
children 0c90b164a735 0af4b1fb0566
line wrap: on
line diff
--- a/libpurple/protocols/jabber/buddy.c	Sat Aug 01 21:45:24 2009 +0000
+++ b/libpurple/protocols/jabber/buddy.c	Sat Aug 01 22:12:30 2009 +0000
@@ -1765,9 +1765,7 @@
 	if(!jb)
 		return m;
 
-	/* XXX: fix the NOT ME below */
-
-	if(js->protocol_version == JABBER_PROTO_0_9 /* && NOT ME */) {
+	if (js->protocol_version == JABBER_PROTO_0_9 && jb != js->user_jb) {
 		if(jb->invisible & JABBER_INVIS_BUDDY) {
 			act = purple_menu_action_new(_("Un-hide From"),
 			                           PURPLE_CALLBACK(jabber_buddy_make_visible),
@@ -1780,7 +1778,7 @@
 		m = g_list_append(m, act);
 	}
 
-	if(jb->subscription & JABBER_SUB_FROM /* && NOT ME */) {
+	if(jb->subscription & JABBER_SUB_FROM && jb != js->user_jb) {
 		act = purple_menu_action_new(_("Cancel Presence Notification"),
 		                           PURPLE_CALLBACK(jabber_buddy_cancel_presence_notification),
 		                           NULL, NULL);
@@ -1793,7 +1791,7 @@
 		                           NULL, NULL);
 		m = g_list_append(m, act);
 
-	} else /* if(NOT ME) */{
+	} else if (jb != js->user_jb) {
 
 		/* shouldn't this just happen automatically when the buddy is
 		   removed? */