|
From: <fac...@us...> - 2006-09-06 03:59:01
|
Revision: 17177
http://svn.sourceforge.net/gaim/?rev=17177&view=rev
Author: faceprint
Date: 2006-09-05 20:58:53 -0700 (Tue, 05 Sep 2006)
Log Message:
-----------
commit part of 1547648
commit some jabber stuff I did a few days ago and forgot about
Modified Paths:
--------------
trunk/libgaim/protocols/jabber/buddy.c
trunk/libgaim/protocols/jabber/chat.c
trunk/libgaim/protocols/jabber/presence.c
trunk/libgaim/protocols/jabber/presence.h
Modified: trunk/libgaim/protocols/jabber/buddy.c
===================================================================
--- trunk/libgaim/protocols/jabber/buddy.c 2006-09-06 03:12:05 UTC (rev 17176)
+++ trunk/libgaim/protocols/jabber/buddy.c 2006-09-06 03:58:53 UTC (rev 17177)
@@ -658,6 +658,8 @@
purdy = gaim_strdup_withhtml(jbr->status);
g_string_append_printf(info_text, "<b>%s:</b> %s<br/>",
_("Resource"), jbr->name);
+ g_string_append_printf(info_text, "<b>%s:</b> %d<br/>",
+ _("Priority"), jbr->priority);
g_string_append_printf(info_text, "<b>%s:</b> %s%s%s<br/>",
_("Status"), jabber_buddy_state_get_name(jbr->state),
purdy ? ": " : "",
@@ -1190,7 +1192,7 @@
JabberBuddy *jb = jabber_buddy_find(js, who, TRUE);
xmlnode *presence;
JabberBuddyState state;
- const char *msg;
+ char *msg;
int priority;
account = gaim_connection_get_account(js->gc);
@@ -1200,6 +1202,8 @@
gaim_status_to_jabber(status, &state, &msg, &priority);
presence = jabber_presence_create(state, msg, priority);
+ g_free(msg);
+
xmlnode_set_attrib(presence, "to", who);
if(invisible) {
xmlnode_set_attrib(presence, "type", "invisible");
Modified: trunk/libgaim/protocols/jabber/chat.c
===================================================================
--- trunk/libgaim/protocols/jabber/chat.c 2006-09-06 03:12:05 UTC (rev 17176)
+++ trunk/libgaim/protocols/jabber/chat.c 2006-09-06 03:58:53 UTC (rev 17177)
@@ -205,7 +205,7 @@
GaimPresence *gpresence;
GaimStatus *status;
JabberBuddyState state;
- const char *msg;
+ char *msg;
int priority;
room = g_hash_table_lookup(data, "room");
@@ -265,6 +265,7 @@
full_jid = g_strdup_printf("%s/%s", room_jid, handle);
xmlnode_set_attrib(presence, "to", full_jid);
g_free(full_jid);
+ g_free(msg);
x = xmlnode_new_child(presence, "x");
xmlnode_set_namespace(x, "http://jabber.org/protocol/muc");
@@ -618,7 +619,7 @@
GaimPresence *gpresence;
GaimStatus *status;
JabberBuddyState state;
- const char *msg;
+ char *msg;
int priority;
if(!chat->muc) {
@@ -637,6 +638,7 @@
full_jid = g_strdup_printf("%s@%s/%s", chat->room, chat->server, nick);
xmlnode_set_attrib(presence, "to", full_jid);
g_free(full_jid);
+ g_free(msg);
jabber_send(chat->js, presence);
xmlnode_free(presence);
Modified: trunk/libgaim/protocols/jabber/presence.c
===================================================================
--- trunk/libgaim/protocols/jabber/presence.c 2006-09-06 03:12:05 UTC (rev 17176)
+++ trunk/libgaim/protocols/jabber/presence.c 2006-09-06 03:58:53 UTC (rev 17177)
@@ -66,7 +66,7 @@
JabberBuddyResource *jbr;
if((jb = jabber_buddy_find(js, my_base_jid, TRUE))) {
JabberBuddyState state;
- const char *msg;
+ char *msg;
int priority;
gaim_status_to_jabber(gstatus, &state, &msg, &priority);
@@ -81,6 +81,8 @@
} else {
gaim_prpl_got_user_status(js->gc->account, my_base_jid, "offline", msg ? "message" : NULL, msg, NULL);
}
+
+ g_free(msg);
}
}
g_free(my_base_jid);
@@ -95,7 +97,6 @@
int primitive;
xmlnode *presence, *x, *photo;
char *stripped = NULL;
- const char *msg;
JabberBuddyState state;
int priority;
@@ -111,10 +112,8 @@
gc = gaim_account_get_connection(account);
js = gc->proto_data;
- gaim_status_to_jabber(status, &state, &msg, &priority);
+ gaim_status_to_jabber(status, &state, &stripped, &priority);
- if(msg)
- gaim_markup_html_to_xhtml(msg, NULL, &stripped);
presence = jabber_presence_create(state, stripped, priority);
g_free(stripped);
@@ -604,9 +603,10 @@
xmlnode_free(presence);
}
-void gaim_status_to_jabber(const GaimStatus *status, JabberBuddyState *state, const char **msg, int *priority)
+void gaim_status_to_jabber(const GaimStatus *status, JabberBuddyState *state, char **msg, int *priority)
{
const char *status_id = NULL;
+ const char *formatted_msg = NULL;
if(state) *state = JABBER_BUDDY_STATE_UNKNOWN;
if(msg) *msg = NULL;
@@ -621,11 +621,14 @@
}
if(msg) {
- *msg = gaim_status_get_attr_string(status, "message");
+ formatted_msg = gaim_status_get_attr_string(status, "message");
/* if the message is blank, then there really isn't a message */
- if(*msg && !**msg)
- *msg = NULL;
+ if(formatted_msg && !*formatted_msg)
+ formatted_msg = NULL;
+
+ if(formatted_msg)
+ gaim_markup_html_to_xhtml(formatted_msg, NULL, msg);
}
if(priority)
Modified: trunk/libgaim/protocols/jabber/presence.h
===================================================================
--- trunk/libgaim/protocols/jabber/presence.h 2006-09-06 03:12:05 UTC (rev 17176)
+++ trunk/libgaim/protocols/jabber/presence.h 2006-09-06 03:58:53 UTC (rev 17177)
@@ -32,6 +32,6 @@
void jabber_presence_subscription_set(JabberStream *js, const char *who,
const char *type);
void jabber_presence_fake_to_self(JabberStream *js, const GaimStatus *status);
-void gaim_status_to_jabber(const GaimStatus *status, JabberBuddyState *state, const char **msg, int *priority);
+void gaim_status_to_jabber(const GaimStatus *status, JabberBuddyState *state, char **msg, int *priority);
#endif /* _GAIM_JABBER_PRESENCE_H_ */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|