changeset 10486:84bc372a621e

[gaim-migrate @ 11776] jabber status stuff committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sat, 08 Jan 2005 18:58:19 +0000
parents 58ab47ed31bf
children 659edfcac14e
files src/protocols/jabber/jabber.c src/protocols/jabber/presence.c
diffstat 2 files changed, 32 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/jabber/jabber.c	Sat Jan 08 18:53:49 2005 +0000
+++ b/src/protocols/jabber/jabber.c	Sat Jan 08 18:58:19 2005 +0000
@@ -971,8 +971,11 @@
 			gaim_value_new(GAIM_TYPE_STRING), NULL);
 	types = g_list_append(types, type);
 
-	type = gaim_status_type_new_with_attrs(GAIM_STATUS_ONLINE, "online",
-			_("Online"), TRUE, TRUE, FALSE, "priority", _("Priority"),
+	type = gaim_status_type_new_full(GAIM_STATUS_ONLINE, "online", _("Online"), FALSE, TRUE, FALSE);
+	types = g_list_append(types, type);
+
+	type = gaim_status_type_new_with_attrs(GAIM_STATUS_AVAILABLE, "available",
+			_("Available"), TRUE, TRUE, FALSE, "priority", _("Priority"),
 			gaim_value_new(GAIM_TYPE_INT), "message", _("Message"),
 			gaim_value_new(GAIM_TYPE_STRING), NULL);
 	types = g_list_append(types, type);
--- a/src/protocols/jabber/presence.c	Sat Jan 08 18:53:49 2005 +0000
+++ b/src/protocols/jabber/presence.c	Sat Jan 08 18:58:19 2005 +0000
@@ -97,6 +97,9 @@
 	JabberBuddyState state;
 	int priority;
 
+	if(!gaim_status_is_active(status))
+		return;
+
 	if(!account) return ;
 	gc = account->gc;
 
@@ -450,6 +453,29 @@
 				g_free(chat->handle);
 				chat->handle = g_strdup(jid->resource);
 				gaim_conv_chat_set_nick(GAIM_CONV_CHAT(chat->conv), jid->resource);
+
+				/* <iq to='room@server'
+				   type='get'>
+				   <query xmlns='http://jabber.org/protocol/disco#info'
+				   node='http://jabber.org/protocol/muc#traffic'/>
+				   </iq>
+				   */
+				/* expected response format:
+				   <iq from='room@server'
+				   type='get'>
+				   <query xmlns='http://jabber.org/protocol/disco#info'
+				   node='http://jabber.org/protocol/muc#traffic'>
+				   <feature var='http://jabber.org/protocol/xhtml-im'/>
+				   <feature var='jabber:x:roster/'/>
+				   </query>
+				   </iq>
+				   */
+				/*
+				 * XXX: i'm not sure if we turn off XHTML unless we get
+				 * xhtml back in this, or if we turn it off only if we
+				 * get a response, and it's not there.  Ask stpeter to
+				 * clarify.
+				 */
 			}
 
 			jabber_buddy_track_resource(jb, jid->resource, priority, state,
@@ -466,7 +492,7 @@
 		}
 		g_free(room_jid);
 	} else {
-		if(state != JABBER_BUDDY_STATE_ERROR && !(jb->subscription & JABBER_SUB_TO)) {
+		if(state != JABBER_BUDDY_STATE_ERROR && !(jb->subscription & JABBER_SUB_TO || jb->subscription & JABBER_SUB_PENDING)) {
 			gaim_debug(GAIM_DEBUG_INFO, "jabber",
 					"got unexpected presence from %s, ignoring\n", from);
 			jabber_id_free(jid);