Mercurial > pidgin
diff src/protocols/jabber/chat.c @ 9954:a9fb4493ae22
[gaim-migrate @ 10851]
a combination of the hacking i've been doing on jabber, and the patch datallah just sent me
committer: Tailor Script <tailor@pidgin.im>
| author | Nathan Walp <nwalp@pidgin.im> |
|---|---|
| date | Sun, 05 Sep 2004 17:10:39 +0000 |
| parents | e74eb0d11f86 |
| children | ac98ece02b1f |
line wrap: on
line diff
--- a/src/protocols/jabber/chat.c Sun Sep 05 06:29:51 2004 +0000 +++ b/src/protocols/jabber/chat.c Sun Sep 05 17:10:39 2004 +0000 @@ -196,6 +196,11 @@ xmlnode *presence, *x; char *tmp, *room_jid, *full_jid; JabberStream *js = gc->proto_data; + GaimPresence *gpresence; + GaimStatus *status; + JabberBuddyState state; + const char *msg; + int priority; room = g_hash_table_lookup(data, "room"); server = g_hash_table_lookup(data, "server"); @@ -245,7 +250,12 @@ g_hash_table_insert(js->chats, room_jid, chat); - presence = jabber_presence_create(gc->away_state, gc->away); + gpresence = gaim_account_get_presence(gc->account); + status = gaim_presence_get_active_status(gpresence); + + gaim_status_to_jabber(status, &state, &msg, &priority); + + presence = jabber_presence_create(state, msg, priority); full_jid = g_strdup_printf("%s/%s", room_jid, handle); xmlnode_set_attrib(presence, "to", full_jid); g_free(full_jid); @@ -599,6 +609,11 @@ { xmlnode *presence; char *full_jid; + GaimPresence *gpresence; + GaimStatus *status; + JabberBuddyState state; + const char *msg; + int priority; if(!chat->muc) { gaim_conv_chat_write(GAIM_CONV_CHAT(chat->conv), "", @@ -607,7 +622,12 @@ return; } - presence = jabber_presence_create(chat->js->gc->away_state, chat->js->gc->away); + gpresence = gaim_account_get_presence(chat->js->gc->account); + status = gaim_presence_get_active_status(gpresence); + + gaim_status_to_jabber(status, &state, &msg, &priority); + + presence = jabber_presence_create(state, msg, priority); full_jid = g_strdup_printf("%s@%s/%s", chat->room, chat->server, nick); xmlnode_set_attrib(presence, "to", full_jid); g_free(full_jid);
