--- a/libpurple/protocols/jabber/adhoccommands.c Sat Sep 15 16:48:23 2007 +0000
+++ b/libpurple/protocols/jabber/adhoccommands.c Sat Sep 15 18:27:01 2007 +0000
@@ -151,8 +151,11 @@
xmlnode *note = xmlnode_get_child(command,"note");
- purple_notify_info(NULL, xmlnode_get_attrib(packet, "from"), xmlnode_get_data(note), NULL);
+ char *data = xmlnode_get_data(note); + purple_notify_info(NULL, xmlnode_get_attrib(packet, "from"), data, NULL); jabber_x_data_request(js, xdata, (jabber_x_data_cb)do_adhoc_ignoreme, NULL);
--- a/libpurple/protocols/jabber/buddy.c Sat Sep 15 16:48:23 2007 +0000
+++ b/libpurple/protocols/jabber/buddy.c Sat Sep 15 18:27:01 2007 +0000
@@ -1455,10 +1455,13 @@
img = purple_base64_decode(b64data, &size);
purple_buddy_icons_set_for_user(purple_connection_get_account(js->gc), from, img, size, checksum);
void jabber_buddy_avatar_update_metadata(JabberStream *js, const char *from, xmlnode *items) {
--- a/libpurple/protocols/jabber/jabber.c Sat Sep 15 16:48:23 2007 +0000
+++ b/libpurple/protocols/jabber/jabber.c Sat Sep 15 18:27:01 2007 +0000
@@ -813,7 +813,7 @@
if(account->registration_cb)
(account->registration_cb)(account, FALSE, account->registration_cb_user_data);
jabber_connection_schedule_close(cbdata->js);
@@ -882,12 +882,12 @@
if((href = xmlnode_get_data(url))) {
purple_notify_uri(NULL, href);
- js->gc->wants_to_die = TRUE;
- if(account->registration_cb) /* succeeded, but we have no login info */
- (account->registration_cb)(account, TRUE, account->registration_cb_user_data);
- jabber_connection_schedule_close(js);
+ js->gc->wants_to_die = TRUE; + if(account->registration_cb) /* succeeded, but we have no login info */ + (account->registration_cb)(account, TRUE, account->registration_cb_user_data); + jabber_connection_schedule_close(js); @@ -987,14 +987,14 @@
purple_request_field_group_add_field(group, field);
- if((y = xmlnode_get_child(query, "instructions")))
- instructions = xmlnode_get_data(y);
+ if((y = xmlnode_get_child(query, "instructions"))) + instructions = xmlnode_get_data(y); instructions = g_strdup(_("Please fill out the information below "
"to change your account registration."));
- instructions = g_strdup(_("Please fill out the information below "
- "to register your new account."));
+ instructions = g_strdup(_("Please fill out the information below " + "to register your new account.")); cbdata = g_new0(JabberRegisterCBData, 1);
@@ -1019,8 +1019,8 @@
void jabber_register_start(JabberStream *js)
--- a/libpurple/protocols/jabber/message.c Sat Sep 15 16:48:23 2007 +0000
+++ b/libpurple/protocols/jabber/message.c Sat Sep 15 18:27:01 2007 +0000
@@ -324,7 +324,7 @@
if(!strcmp(type, "normal"))
jm->type = JABBER_MESSAGE_NORMAL;
- else if(!strcmp(type, "chat"))
+ else if(!strcmp(type, "chat")) jm->type = JABBER_MESSAGE_CHAT;
else if(!strcmp(type, "groupchat"))
jm->type = JABBER_MESSAGE_GROUPCHAT;
--- a/libpurple/protocols/jabber/presence.c Sat Sep 15 16:48:23 2007 +0000
+++ b/libpurple/protocols/jabber/presence.c Sat Sep 15 18:27:01 2007 +0000
@@ -192,16 +192,11 @@
jabber_tune_set(js->gc, &tuneinfo);
- g_free(js->old_artist);
- g_free(js->old_source);
+ g_free(js->old_artist); + g_free(js->old_source); js->old_artist = g_strdup(artist);
js->old_title = g_strdup(title);
js->old_source = g_strdup(source);
--- a/libpurple/protocols/jabber/usernick.c Sat Sep 15 16:48:23 2007 +0000
+++ b/libpurple/protocols/jabber/usernick.c Sat Sep 15 18:27:01 2007 +0000
@@ -33,7 +33,7 @@
xmlnode *item = xmlnode_get_child(items, "item");
JabberBuddy *buddy = jabber_buddy_find(js, from, FALSE);
- const char *nickname = NULL;
/* ignore the tune of people not on our buddy list */
@@ -43,8 +43,8 @@
nickname = xmlnode_get_data(nick);
serv_got_alias(js->gc, from, nickname);
static void do_nick_set(JabberStream *js, const char *nick) {
@@ -64,7 +64,7 @@
static void do_nick_got_own_nick_cb(JabberStream *js, const char *from, xmlnode *items) {
- const char *oldnickname = NULL;
+ char *oldnickname = NULL; xmlnode *item = xmlnode_get_child(items,"item");
@@ -77,6 +77,7 @@
_("This information is visible to all contacts on your contact list, so choose something appropriate."),
oldnickname, FALSE, FALSE, NULL, _("Set"), PURPLE_CALLBACK(do_nick_set), _("Cancel"), NULL,
purple_connection_get_account(js->gc), NULL, NULL, js);
static void do_nick_set_nick(PurplePluginAction *action) {
--- a/libpurple/protocols/jabber/usertune.c Sat Sep 15 16:48:23 2007 +0000
+++ b/libpurple/protocols/jabber/usertune.c Sat Sep 15 18:27:01 2007 +0000
@@ -41,48 +41,61 @@
- tuneinfodata.artist = "";
- tuneinfodata.title = "";
- tuneinfodata.album = "";
- tuneinfodata.track = "";
+ tuneinfodata.artist = NULL; + tuneinfodata.title = NULL; + tuneinfodata.album = NULL; + tuneinfodata.track = NULL;
+ tuneinfodata.url = NULL; tune = xmlnode_get_child_with_namespace(item, "tune", "http://jabber.org/protocol/tune");
+ resource = jabber_buddy_find_resource(buddy, NULL); for (tuneinfo = tune->child; tuneinfo; tuneinfo = tuneinfo->next) {
if (tuneinfo->type == XMLNODE_TYPE_TAG) {
if (!strcmp(tuneinfo->name, "artist")) {
- if (tuneinfodata.artist[0] == '\0') /* only pick the first one */
+ if (tuneinfodata.artist == NULL) /* only pick the first one */ tuneinfodata.artist = xmlnode_get_data(tuneinfo);
} else if (!strcmp(tuneinfo->name, "length")) {
if (tuneinfodata.time == -1) {
char *length = xmlnode_get_data(tuneinfo);
tuneinfodata.time = strtol(length, NULL, 10);
} else if (!strcmp(tuneinfo->name, "source")) {
- if (tuneinfodata.album[0] == '\0') /* only pick the first one */
+ if (tuneinfodata.album == NULL) /* only pick the first one */ tuneinfodata.album = xmlnode_get_data(tuneinfo);
} else if (!strcmp(tuneinfo->name, "title")) {
- if (tuneinfodata.title[0] == '\0') /* only pick the first one */
+ if (tuneinfodata.title == NULL) /* only pick the first one */ tuneinfodata.title = xmlnode_get_data(tuneinfo);
} else if (!strcmp(tuneinfo->name, "track")) {
- if (tuneinfodata.track[0] == '\0') /* only pick the first one */
+ if (tuneinfodata.track == NULL) /* only pick the first one */ tuneinfodata.track = xmlnode_get_data(tuneinfo);
} else if (!strcmp(tuneinfo->name, "uri")) {
- if (tuneinfodata.url[0] == '\0') /* only pick the first one */
+ if (tuneinfodata.url == NULL) /* only pick the first one */ tuneinfodata.url = xmlnode_get_data(tuneinfo);
- resource = jabber_buddy_find_resource(buddy, NULL);
status_id = jabber_buddy_state_get_status_id(resource->state);
- purple_prpl_got_user_status(js->gc->account, from, status_id, PURPLE_TUNE_ARTIST, tuneinfodata.artist, PURPLE_TUNE_TITLE, tuneinfodata.title, PURPLE_TUNE_ALBUM, tuneinfodata.album, PURPLE_TUNE_TRACK, tuneinfodata.track, PURPLE_TUNE_TIME, tuneinfodata.time, PURPLE_TUNE_URL, tuneinfodata.url, NULL);
+ purple_prpl_got_user_status(js->gc->account, from, status_id, + PURPLE_TUNE_ARTIST, tuneinfodata.artist, + PURPLE_TUNE_TITLE, tuneinfodata.title, + PURPLE_TUNE_ALBUM, tuneinfodata.album, + PURPLE_TUNE_TRACK, tuneinfodata.track, + PURPLE_TUNE_TIME, tuneinfodata.time, + PURPLE_TUNE_URL, tuneinfodata.url, NULL); + g_free(tuneinfodata.artist); + g_free(tuneinfodata.title); + g_free(tuneinfodata.album); + g_free(tuneinfodata.track); + g_free(tuneinfodata.url); void jabber_tune_init(void) {