changeset 17887:233af7fe561c

Removed buzz support.
author Andreas Monitzer <pidgin@monitzer.com>
date Thu, 28 Jun 2007 13:22:13 +0000
parents 7c79957207c3
children cca457b9158b
files libpurple/protocols/jabber/jabber.c libpurple/protocols/jabber/libxmpp.c libpurple/protocols/jabber/message.c libpurple/protocols/jabber/message.h
diffstat 4 files changed, 0 insertions(+), 83 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c	Wed Jun 27 03:56:30 2007 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Thu Jun 28 13:22:13 2007 +0000
@@ -2046,57 +2046,6 @@
 	return PURPLE_CMD_RET_OK;
 }
 
-static PurpleCmdRet jabber_cmd_buzz(PurpleConversation *conv,
-		const char *cmd, char **args, char **error, void *data)
-{
-	JabberStream *js = conv->account->gc->proto_data;
-	xmlnode *msg, *buzz;
-	JabberBuddy *jb;
-	JabberBuddyResource *jbr;
-	char *to;
-	GList *iter;
-
-	if(!args || !args[0])
-		return PURPLE_CMD_RET_FAILED;
-	
-	jb = jabber_buddy_find(js, args[0], FALSE);
-	if(!jb) {
-		*error = g_strdup_printf(_("Unable to buzz, because there is nothing known about user %s."), args[0]);
-		return PURPLE_CMD_RET_FAILED;
-	}
-	
-	jbr = jabber_buddy_find_resource(jb, NULL);
-	if(!jbr) {
-		*error = g_strdup_printf(_("Unable to buzz, because user %s might be offline."), args[0]);
-		return PURPLE_CMD_RET_FAILED;
-	}
-	if(!jbr->caps) {
-		*error = g_strdup_printf(_("Unable to buzz, because there is nothing known about user %s."), args[0]);
-		return PURPLE_CMD_RET_FAILED;
-	}
-	for(iter = jbr->caps->features; iter; iter = g_list_next(iter)) {
-		if(!strcmp(iter->data, "http://pidgin.im/xmpp/buzz")) {
-			msg = xmlnode_new("message");
-			to = g_strdup_printf("%s/%s", args[0], jbr->name);
-			xmlnode_set_attrib(msg,"to",to);
-			g_free(to);
-			
-			/* avoid offline storage */
-			xmlnode_set_attrib(msg,"type","headline");
-			
-			buzz = xmlnode_new_child(msg,"buzz");
-			xmlnode_set_namespace(buzz,"http://pidgin.im/xmpp/buzz");
-			
-			jabber_send(js,msg);
-			xmlnode_free(msg);
-			
-			return PURPLE_CMD_RET_OK;
-		}
-	}
-	*error = g_strdup_printf(_("Unable to buzz, because the user %s does not support it."), args[0]);
-	return PURPLE_CMD_RET_FAILED;
-}
-
 gboolean jabber_offline_message(const PurpleBuddy *buddy)
 {
 	return TRUE;
@@ -2180,10 +2129,6 @@
 					  "prpl-jabber", jabber_cmd_ping,
 					  _("ping &lt;jid&gt;:	Ping a user/component/server."),
 					  NULL);
-	purple_cmd_register("buzz", "s", PURPLE_CMD_P_PRPL,
-					  PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_PRPL_ONLY,
-					  "prpl-jabber", jabber_cmd_buzz,
-					  _("buzz: Buzz a user to get their attention"), NULL);
 }
 
 void
--- a/libpurple/protocols/jabber/libxmpp.c	Wed Jun 27 03:56:30 2007 +0000
+++ b/libpurple/protocols/jabber/libxmpp.c	Thu Jun 28 13:22:13 2007 +0000
@@ -239,7 +239,6 @@
 
 		jabber_add_feature("avatarmeta", AVATARNAMESPACEMETA, jabber_pep_namespace_only_when_pep_enabled_cb);
 		jabber_add_feature("avatardata", AVATARNAMESPACEDATA, jabber_pep_namespace_only_when_pep_enabled_cb);
-		jabber_add_feature("buzz", "http://pidgin.im/xmpp/buzz", NULL);
 		
 		jabber_pep_register_handler("avatar", AVATARNAMESPACEMETA, jabber_buddy_avatar_update_metadata);
 }
--- a/libpurple/protocols/jabber/message.c	Wed Jun 27 03:56:30 2007 +0000
+++ b/libpurple/protocols/jabber/message.c	Thu Jun 28 13:22:13 2007 +0000
@@ -278,27 +278,6 @@
 	g_free(buf);
 }
 
-static void handle_buzz(JabberMessage *jm) {
-	PurpleBuddy *buddy;
-	PurpleAccount *account;
-	PurpleConversation *c;
-	char *username, *str;
-	
-	account = purple_connection_get_account(jm->js->gc);
-	c = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, jm->from);
-	
-	if ((buddy = purple_find_buddy(account, jm->from)) != NULL)
-		username = g_markup_escape_text(purple_buddy_get_alias(buddy), -1);
-	else
-		username = g_markup_escape_text(jm->from, -1);
-	
-	str = g_strdup_printf(_("%s just sent you a Buzz!"), username);
-	
-	purple_conversation_write(c, NULL, str, PURPLE_MESSAGE_SYSTEM|PURPLE_MESSAGE_NOTIFY, time(NULL));
-	g_free(username);
-	g_free(str);
-}
-
 void jabber_message_parse(JabberStream *js, xmlnode *packet)
 {
 	JabberMessage *jm;
@@ -384,8 +363,6 @@
 			jm->type = JABBER_MESSAGE_EVENT;
 			for(items = xmlnode_get_child(child,"items"); items; items = items->next)
 				jm->eventitems = g_list_append(jm->eventitems, items);
-		} else if(!strcmp(child->name, "buzz") && !strcmp(xmlns,"http://pidgin.im/xmpp/buzz")) {
-			jm->hasBuzz = TRUE;
 		} else if(!strcmp(child->name, "error")) {
 			const char *code = xmlnode_get_attrib(child, "code");
 			char *code_txt = NULL;
@@ -451,9 +428,6 @@
 		}
 	}
 	
-	if(jm->hasBuzz)
-		handle_buzz(jm);
-
 	switch(jm->type) {
 		case JABBER_MESSAGE_NORMAL:
 		case JABBER_MESSAGE_CHAT:
--- a/libpurple/protocols/jabber/message.h	Wed Jun 27 03:56:30 2007 +0000
+++ b/libpurple/protocols/jabber/message.h	Thu Jun 28 13:22:13 2007 +0000
@@ -40,7 +40,6 @@
 	} type;
 	time_t sent;
 	gboolean delayed;
-	gboolean hasBuzz;
 	char *id;
 	char *from;
 	char *to;