diff libpurple/protocols/jabber/libxmpp.c @ 23445:4ac5db6e39f3

Custom smileys for XMPP according to XEP 0231. Refs #5627. committer: Sadrul Habib Chowdhury <imadil@gmail.com>
author Marcus Lundblad <ml@update.uu.se>
date Sun, 01 Jun 2008 20:55:54 +0000
parents bb41bdce8981
children 1de1494a13e5
line wrap: on
line diff
--- a/libpurple/protocols/jabber/libxmpp.c	Sun Jun 01 18:08:14 2008 +0000
+++ b/libpurple/protocols/jabber/libxmpp.c	Sun Jun 01 20:55:54 2008 +0000
@@ -43,6 +43,7 @@
 #include "pep.h"
 #include "usertune.h"
 #include "caps.h"
+#include "data.h"
 
 static PurplePluginProtocolInfo prpl_info =
 {
@@ -240,6 +241,13 @@
 	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
 						  option);
 
+	/* this should probably be part of global smiley theme settings later on,
+	  shared with MSN */
+	option = purple_account_option_bool_new(_("Show Custom Smileys"),
+		"custom_smileys", TRUE);
+	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
+		option);
+
 	jabber_init_plugin(plugin);
 
 	purple_prefs_remove("/plugins/prpl/jabber");
@@ -262,11 +270,16 @@
 	
 	jabber_tune_init();
 	jabber_caps_init();
+	jabber_data_init();
 
 	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://www.xmpp.org/extensions/xep-0224.html#ns", jabber_buzz_isenabled);
-	
+	jabber_add_feature("buzz", "http://www.xmpp.org/extensions/xep-0224.html#ns",
+					   jabber_buzz_isenabled);
+	/* this string will need to be updated when XEP-0231 turns "draft" */
+	jabber_add_feature("smileys", XEP_0231_IB_IMAGE_NAMESPACE,
+					   jabber_custom_smileys_isenabled);
+
 	jabber_pep_register_handler("avatar", AVATARNAMESPACEMETA, jabber_buddy_avatar_update_metadata);
 }