diff libpurple/protocols/jabber/jabber.c @ 20643:cb7d809867ac

propagate from branch 'im.pidgin.pidgin' (head b2924d43f1e1cb2d01705932d9a06df6eedf7ac0) to branch 'im.pidgin.sadrul.currentmedia' (head 15698906f0fff90b76df130d6cebe3f183c2cfaf)
author Mark Doliner <mark@kingant.net>
date Tue, 25 Sep 2007 09:01:03 +0000
parents ba6cd9c25853 be2538a92099
children 5f829728a1a5
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c	Tue Sep 25 08:59:30 2007 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Tue Sep 25 09:01:03 2007 +0000
@@ -2216,6 +2216,44 @@
 	return PURPLE_CMD_RET_FAILED;
 }
 
+GList *jabber_attention_types(PurpleAccount *account)
+{
+	static GList *types = NULL;
+	PurpleAttentionType *attn;
+
+	if (!types) {
+		attn = g_new0(PurpleAttentionType, 1);
+		attn->name = _("Buzz");
+		attn->incoming_description = _("%s has buzzed you!");
+		attn->outgoing_description = _("Buzzing %s...");
+		types = g_list_append(types, attn);
+	}
+
+	return types;
+}
+
+gboolean jabber_send_attention(PurpleConnection *gc, const char *username, guint code)
+{
+	PurpleConversation *conv;
+	char *error;
+	char *args[1];
+	PurpleCmdRet ret;
+
+	conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_ANY, username, gc->account);
+
+	args[0] = (char *)username;
+
+	ret = jabber_cmd_buzz(conv, "buzz", args, &error, NULL);
+
+	if (ret == PURPLE_CMD_RET_FAILED) {
+		purple_debug_error("jabber", "jabber_send_attention: jabber_cmd_buzz failed with error: %s\n", error ? error : "(NULL)");
+		return FALSE;
+	} else {
+		return TRUE;
+	}
+}
+
+
 gboolean jabber_offline_message(const PurpleBuddy *buddy)
 {
 	return TRUE;