cpw.rekkanoryo.icqxstatus: f985eb17: Implemented the get_moods prpl function ...
malu at pidgin.im
malu at pidgin.im
Mon Feb 8 16:40:49 EST 2010
-----------------------------------------------------------------
Revision: f985eb171fd112869975939414e86c9500780b92
Ancestor: 26b0e8daa57b216760d49529b6fbd6f71883d959
Author: malu at pidgin.im
Date: 2010-02-08T21:38:26
Branch: im.pidgin.cpw.rekkanoryo.icqxstatus
URL: http://d.pidgin.im/viewmtn/revision/info/f985eb171fd112869975939414e86c9500780b92
Modified files:
libpurple/protocols/jabber/jabber.c
libpurple/protocols/jabber/libxmpp.c
libpurple/protocols/jabber/usermood.c
libpurple/protocols/jabber/usermood.h
ChangeLog:
Implemented the get_moods prpl function for XMPP. Enables the generic mood
chooser.
Doesn't actually work yet...
-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jabber.c 5755b7835f7f916c866ccd46c8d70275533ed4be
+++ libpurple/protocols/jabber/jabber.c dd40318031d3f1521ca2207113593960b292a6f1
@@ -2132,6 +2132,14 @@ GList *jabber_status_types(PurpleAccount
NULL);
types = g_list_prepend(types, type);
+
+ type = purple_status_type_new_with_attrs(PURPLE_STATUS_MOOD,
+ "mood", NULL, TRUE, TRUE, TRUE,
+ PURPLE_MOOD_NAME, _("Mood Name"), purple_value_new(PURPLE_TYPE_STRING),
+ PURPLE_MOOD_COMMENT, _("Mood Comment"), purple_value_new(PURPLE_TYPE_STRING),
+ NULL);
+ types = g_list_prepend(types, type);
+
priority_value = purple_value_new(PURPLE_TYPE_INT);
purple_value_set_int(priority_value, 1);
buzz_enabled = purple_value_new(PURPLE_TYPE_BOOLEAN);
============================================================
--- libpurple/protocols/jabber/libxmpp.c 3ad955d9fda8d453caac327f3e52d7a8f6dd9e31
+++ libpurple/protocols/jabber/libxmpp.c 8c3e2d93475c65ac7c1e69a29bc3ddd48a970227
@@ -43,6 +43,7 @@
#include "presence.h"
#include "google.h"
#include "pep.h"
+#include "usermood.h"
#include "usertune.h"
#include "caps.h"
#include "data.h"
@@ -126,7 +127,7 @@ static PurplePluginProtocolInfo prpl_inf
NULL, /* get_account_text_table */
jabber_initiate_media, /* initiate_media */
jabber_get_media_caps, /* get_media_caps */
- NULL /* get_moods */
+ jabber_get_moods /* get_moods */
};
static gboolean load_plugin(PurplePlugin *plugin)
============================================================
--- libpurple/protocols/jabber/usermood.c eda67ccfaa040cd2efed6fa6db5cae347dd2562c
+++ libpurple/protocols/jabber/usermood.c 80d735e42faaf1b8210d905a77047e7bea12eace
@@ -119,6 +119,10 @@ static PurpleMood moods[] = {
{NULL, NULL, NULL}
};
+static PurpleMood empty_moods[] = {
+ {NULL, NULL, NULL}
+};
+
static void jabber_mood_cb(JabberStream *js, const char *from, xmlnode *items) {
/* it doesn't make sense to have more than one item here, so let's just pick the first one */
xmlnode *item = xmlnode_get_child(items, "item");
@@ -252,3 +256,17 @@ void jabber_mood_set(JabberStream *js, c
/* publish is freed by jabber_pep_publish -> jabber_iq_send -> jabber_iq_free
(yay for well-defined memory management rules) */
}
+
+PurpleMood *jabber_get_moods(PurpleAccount *account)
+{
+ PurpleConnection *gc = purple_account_get_connection(account);
+ JabberStream *js = (JabberStream *) gc->proto_data;
+
+ if (js->pep) {
+ purple_debug_info("jabber", "get_moods: account supports PEP\n");
+ return moods;
+ } else {
+ purple_debug_info("jabber", "get_moods: account doesn't support PEP\n");
+ return empty_moods;
+ }
+}
\ No newline at end of file
============================================================
--- libpurple/protocols/jabber/usermood.h 70200e3e18415507eaf1f415f7b396804f2ea999
+++ libpurple/protocols/jabber/usermood.h f3a65f1dcc8b9e9d5d89163c8204f0b8b72232e6
@@ -36,4 +36,6 @@ void jabber_mood_set(JabberStream *js,
const char *mood, /* must be one of the valid strings defined in the XEP */
const char *text /* might be NULL */);
+PurpleMood *jabber_get_moods(PurpleAccount *account);
+
#endif /* PURPLE_JABBER_USERMOOD_H_ */
More information about the Commits
mailing list