Sun, 29 Jul 2007 21:32:36 +0000
applied changes from 5542a465de12fedee4ebe7c124a754f9992d0d62
through 2036a94093c55f9dd5b2b0ed1a255f9e24b042c0
I commited this yesterday, but it includes some other changes that I
didn't mean to commit, so I reverted it and now I'm just committing
this file.
Here's the original commit message:
When we get a presence of type="error" from the server that
corresponds to a Jabber chat, only destroy/free/close/leave
the chat room if the error happened while joining (and we
were therefore never in the room).
This fixes the following bug:
1. Join a room
2. Try to change your nickname to something that's being
used by someone else
3. The server gives you an error message, but you're not
actually kicked out of the room
4. Pidgin thinks you've been kicked out and won't let you
send messages to the room, etc.
| 7014 | 1 | /* |
| 15884 | 2 | * purple - Jabber Protocol Plugin |
| 7014 | 3 | * |
| 4 | * Copyright (C) 2003, Nathan Walp <faceprint@faceprint.com> | |
| 5 | * | |
| 6 | * This program is free software; you can redistribute it and/or modify | |
| 7 | * it under the terms of the GNU General Public License as published by | |
| 8 | * the Free Software Foundation; either version 2 of the License, or | |
| 9 | * (at your option) any later version. | |
| 10 | * | |
| 11 | * This program is distributed in the hope that it will be useful, | |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 14 | * GNU General Public License for more details. | |
| 15 | * | |
| 16 | * You should have received a copy of the GNU General Public License | |
| 17 | * along with this program; if not, write to the Free Software | |
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 19 | * | |
| 20 | */ | |
| 21 | #include "internal.h" | |
| 22 | ||
|
15952
c087855dc551
Re-arrange #includes so 'make check' stands a chance of passing during
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15884
diff
changeset
|
23 | #include "account.h" |
|
10684
0325b164a7eb
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10646
diff
changeset
|
24 | #include "cipher.h" |
|
15952
c087855dc551
Re-arrange #includes so 'make check' stands a chance of passing during
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15884
diff
changeset
|
25 | #include "conversation.h" |
| 7014 | 26 | #include "debug.h" |
| 27 | #include "notify.h" | |
| 28 | #include "request.h" | |
| 29 | #include "server.h" | |
| 9954 | 30 | #include "status.h" |
|
7095
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
31 | #include "util.h" |
|
15952
c087855dc551
Re-arrange #includes so 'make check' stands a chance of passing during
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15884
diff
changeset
|
32 | #include "xmlnode.h" |
| 7014 | 33 | |
| 34 | #include "buddy.h" | |
| 35 | #include "chat.h" | |
| 36 | #include "presence.h" | |
| 37 | #include "iq.h" | |
| 38 | #include "jutil.h" | |
| 39 | ||
| 40 | ||
| 41 | static void chats_send_presence_foreach(gpointer key, gpointer val, | |
| 42 | gpointer user_data) | |
| 43 | { | |
| 44 | JabberChat *chat = val; | |
| 45 | xmlnode *presence = user_data; | |
| 8577 | 46 | char *chat_full_jid; |
| 47 | ||
| 48 | if(!chat->conv) | |
| 49 | return; | |
| 50 | ||
| 51 | chat_full_jid = g_strdup_printf("%s@%s/%s", chat->room, chat->server, | |
| 8401 | 52 | chat->handle); |
| 7014 | 53 | |
| 8401 | 54 | xmlnode_set_attrib(presence, "to", chat_full_jid); |
| 7014 | 55 | jabber_send(chat->js, presence); |
| 8401 | 56 | g_free(chat_full_jid); |
| 7014 | 57 | } |
| 58 | ||
| 15884 | 59 | void jabber_presence_fake_to_self(JabberStream *js, const PurpleStatus *gstatus) { |
| 10286 | 60 | char *my_base_jid; |
| 61 | ||
| 62 | if(!js->user) | |
| 63 | return; | |
| 64 | ||
| 65 | my_base_jid = g_strdup_printf("%s@%s", js->user->node, js->user->domain); | |
| 15884 | 66 | if(purple_find_buddy(js->gc->account, my_base_jid)) { |
| 8185 | 67 | JabberBuddy *jb; |
| 68 | JabberBuddyResource *jbr; | |
| 69 | if((jb = jabber_buddy_find(js, my_base_jid, TRUE))) { | |
| 9954 | 70 | JabberBuddyState state; |
| 14525 | 71 | char *msg; |
| 9954 | 72 | int priority; |
| 73 | ||
| 15884 | 74 | purple_status_to_jabber(gstatus, &state, &msg, &priority); |
| 9954 | 75 | |
| 10490 | 76 | if (state == JABBER_BUDDY_STATE_UNAVAILABLE || state == JABBER_BUDDY_STATE_UNKNOWN) { |
|
9744
c2b450de1fc0
[gaim-migrate @ 10609]
Daniel Atallah <datallah@pidgin.im>
parents:
9743
diff
changeset
|
77 | jabber_buddy_remove_resource(jb, js->user->resource); |
|
c2b450de1fc0
[gaim-migrate @ 10609]
Daniel Atallah <datallah@pidgin.im>
parents:
9743
diff
changeset
|
78 | } else { |
| 9954 | 79 | jabber_buddy_track_resource(jb, js->user->resource, priority, state, msg); |
|
9744
c2b450de1fc0
[gaim-migrate @ 10609]
Daniel Atallah <datallah@pidgin.im>
parents:
9743
diff
changeset
|
80 | } |
| 9954 | 81 | if((jbr = jabber_buddy_find_resource(jb, NULL))) { |
| 15884 | 82 | purple_prpl_got_user_status(js->gc->account, my_base_jid, jabber_buddy_state_get_status_id(jbr->state), "priority", jbr->priority, jbr->status ? "message" : NULL, jbr->status, NULL); |
| 9954 | 83 | } else { |
| 15884 | 84 | purple_prpl_got_user_status(js->gc->account, my_base_jid, "offline", msg ? "message" : NULL, msg, NULL); |
| 9954 | 85 | } |
| 14525 | 86 | |
| 87 | g_free(msg); | |
| 8185 | 88 | } |
| 89 | } | |
| 90 | g_free(my_base_jid); | |
| 91 | } | |
| 92 | ||
| 7014 | 93 | |
| 15884 | 94 | void jabber_presence_send(PurpleAccount *account, PurpleStatus *status) |
| 7014 | 95 | { |
| 15884 | 96 | PurpleConnection *gc = NULL; |
|
10382
32e07712e224
[gaim-migrate @ 11608]
Luke Schierer <lschiere@pidgin.im>
parents:
10286
diff
changeset
|
97 | JabberStream *js = NULL; |
|
11251
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11183
diff
changeset
|
98 | gboolean disconnected; |
|
10755
a336a5d3102d
[gaim-migrate @ 12358]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
99 | int primitive; |
| 10189 | 100 | xmlnode *presence, *x, *photo; |
| 7014 | 101 | char *stripped = NULL; |
| 9954 | 102 | JabberBuddyState state; |
| 103 | int priority; | |
| 7014 | 104 | |
|
18195
9cd0565f856e
kill some code duplication when sending current presence
Nathan Walp <nwalp@pidgin.im>
parents:
17703
diff
changeset
|
105 | if(NULL == status) { |
|
9cd0565f856e
kill some code duplication when sending current presence
Nathan Walp <nwalp@pidgin.im>
parents:
17703
diff
changeset
|
106 | PurplePresence *gpresence = purple_account_get_presence(account); |
|
9cd0565f856e
kill some code duplication when sending current presence
Nathan Walp <nwalp@pidgin.im>
parents:
17703
diff
changeset
|
107 | status = purple_presence_get_active_status(gpresence); |
|
9cd0565f856e
kill some code duplication when sending current presence
Nathan Walp <nwalp@pidgin.im>
parents:
17703
diff
changeset
|
108 | } |
|
9cd0565f856e
kill some code duplication when sending current presence
Nathan Walp <nwalp@pidgin.im>
parents:
17703
diff
changeset
|
109 | |
| 15884 | 110 | if(!purple_status_is_active(status)) |
| 10486 | 111 | return; |
| 112 | ||
| 15884 | 113 | disconnected = purple_account_is_disconnected(account); |
|
10755
a336a5d3102d
[gaim-migrate @ 12358]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
114 | |
|
11251
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11183
diff
changeset
|
115 | if(disconnected) |
|
10755
a336a5d3102d
[gaim-migrate @ 12358]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
116 | return; |
|
a336a5d3102d
[gaim-migrate @ 12358]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
117 | |
| 17422 | 118 | primitive = purple_status_type_get_primitive(purple_status_get_type(status)); |
| 119 | ||
| 15884 | 120 | gc = purple_account_get_connection(account); |
|
10755
a336a5d3102d
[gaim-migrate @ 12358]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
121 | js = gc->proto_data; |
|
a336a5d3102d
[gaim-migrate @ 12358]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
122 | |
|
18226
adf83935e838
really and truly enforce the no-presence-before-roster thing
Nathan Walp <nwalp@pidgin.im>
parents:
18195
diff
changeset
|
123 | /* we don't want to send presence before we've gotten our roster */ |
|
adf83935e838
really and truly enforce the no-presence-before-roster thing
Nathan Walp <nwalp@pidgin.im>
parents:
18195
diff
changeset
|
124 | if(!js->roster_parsed) { |
|
adf83935e838
really and truly enforce the no-presence-before-roster thing
Nathan Walp <nwalp@pidgin.im>
parents:
18195
diff
changeset
|
125 | purple_debug_info("jabber", "attempt to send presence before roster retrieved\n"); |
|
adf83935e838
really and truly enforce the no-presence-before-roster thing
Nathan Walp <nwalp@pidgin.im>
parents:
18195
diff
changeset
|
126 | return; |
|
adf83935e838
really and truly enforce the no-presence-before-roster thing
Nathan Walp <nwalp@pidgin.im>
parents:
18195
diff
changeset
|
127 | } |
|
adf83935e838
really and truly enforce the no-presence-before-roster thing
Nathan Walp <nwalp@pidgin.im>
parents:
18195
diff
changeset
|
128 | |
| 15884 | 129 | purple_status_to_jabber(status, &state, &stripped, &priority); |
| 9954 | 130 | |
| 7014 | 131 | |
| 9954 | 132 | presence = jabber_presence_create(state, stripped, priority); |
| 133 | g_free(stripped); | |
| 7014 | 134 | |
| 10189 | 135 | if(js->avatar_hash) { |
| 136 | x = xmlnode_new_child(presence, "x"); | |
| 13808 | 137 | xmlnode_set_namespace(x, "vcard-temp:x:update"); |
| 10189 | 138 | photo = xmlnode_new_child(x, "photo"); |
| 139 | xmlnode_insert_data(photo, js->avatar_hash, -1); | |
| 140 | } | |
| 141 | ||
| 12265 | 142 | jabber_send(js, presence); |
| 143 | ||
| 7014 | 144 | g_hash_table_foreach(js->chats, chats_send_presence_foreach, presence); |
| 145 | xmlnode_free(presence); | |
| 8185 | 146 | |
| 9954 | 147 | jabber_presence_fake_to_self(js, status); |
| 7014 | 148 | } |
| 149 | ||
| 9954 | 150 | xmlnode *jabber_presence_create(JabberBuddyState state, const char *msg, int priority) |
| 7014 | 151 | { |
| 13385 | 152 | xmlnode *show, *status, *presence, *pri, *c; |
| 9954 | 153 | const char *show_string = NULL; |
| 7014 | 154 | |
| 155 | presence = xmlnode_new("presence"); | |
| 156 | ||
| 9954 | 157 | if(state == JABBER_BUDDY_STATE_UNAVAILABLE) |
| 158 | xmlnode_set_attrib(presence, "type", "unavailable"); | |
| 159 | else if(state != JABBER_BUDDY_STATE_ONLINE && | |
| 160 | state != JABBER_BUDDY_STATE_UNKNOWN && | |
| 161 | state != JABBER_BUDDY_STATE_ERROR) | |
| 12683 | 162 | show_string = jabber_buddy_state_get_show(state); |
| 9954 | 163 | |
| 164 | if(show_string) { | |
| 165 | show = xmlnode_new_child(presence, "show"); | |
| 166 | xmlnode_insert_data(show, show_string, -1); | |
| 7014 | 167 | } |
| 168 | ||
| 9954 | 169 | if(msg) { |
| 7014 | 170 | status = xmlnode_new_child(presence, "status"); |
| 171 | xmlnode_insert_data(status, msg, -1); | |
| 172 | } | |
| 173 | ||
| 11568 | 174 | if(priority) { |
| 175 | char *pstr = g_strdup_printf("%d", priority); | |
| 176 | pri = xmlnode_new_child(presence, "priority"); | |
| 177 | xmlnode_insert_data(pri, pstr, -1); | |
| 178 | g_free(pstr); | |
| 179 | } | |
| 180 | ||
| 13385 | 181 | /* JEP-0115 */ |
| 182 | c = xmlnode_new_child(presence, "c"); | |
| 13808 | 183 | xmlnode_set_namespace(c, "http://jabber.org/protocol/caps"); |
| 13385 | 184 | xmlnode_set_attrib(c, "node", CAPS0115_NODE); |
| 185 | xmlnode_set_attrib(c, "ver", VERSION); | |
| 186 | ||
| 7014 | 187 | return presence; |
| 188 | } | |
| 189 | ||
| 190 | struct _jabber_add_permit { | |
| 15884 | 191 | PurpleConnection *gc; |
| 12285 | 192 | JabberStream *js; |
| 7014 | 193 | char *who; |
| 194 | }; | |
| 195 | ||
| 196 | static void authorize_add_cb(struct _jabber_add_permit *jap) | |
| 197 | { | |
|
14030
23144f1dc950
[gaim-migrate @ 16525]
Mark Doliner <markdoliner@pidgin.im>
parents:
13952
diff
changeset
|
198 | jabber_presence_subscription_set(jap->gc->proto_data, jap->who, |
|
23144f1dc950
[gaim-migrate @ 16525]
Mark Doliner <markdoliner@pidgin.im>
parents:
13952
diff
changeset
|
199 | "subscribed"); |
| 7014 | 200 | g_free(jap->who); |
| 201 | g_free(jap); | |
| 202 | } | |
| 203 | ||
| 204 | static void deny_add_cb(struct _jabber_add_permit *jap) | |
| 205 | { | |
|
14030
23144f1dc950
[gaim-migrate @ 16525]
Mark Doliner <markdoliner@pidgin.im>
parents:
13952
diff
changeset
|
206 | jabber_presence_subscription_set(jap->gc->proto_data, jap->who, |
|
23144f1dc950
[gaim-migrate @ 16525]
Mark Doliner <markdoliner@pidgin.im>
parents:
13952
diff
changeset
|
207 | "unsubscribed"); |
| 7014 | 208 | |
| 209 | g_free(jap->who); | |
| 210 | g_free(jap); | |
| 211 | } | |
| 212 | ||
| 10189 | 213 | static void jabber_vcard_parse_avatar(JabberStream *js, xmlnode *packet, gpointer blah) |
| 214 | { | |
| 10941 | 215 | JabberBuddy *jb = NULL; |
| 216 | xmlnode *vcard, *photo, *binval; | |
|
11127
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
11013
diff
changeset
|
217 | char *text; |
|
11137
cf40226ddff7
[gaim-migrate @ 13201]
Mark Doliner <markdoliner@pidgin.im>
parents:
11127
diff
changeset
|
218 | guchar *data; |
|
11127
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
11013
diff
changeset
|
219 | gsize size; |
| 10189 | 220 | const char *from = xmlnode_get_attrib(packet, "from"); |
| 221 | ||
| 222 | if(!from) | |
| 223 | return; | |
| 224 | ||
| 10941 | 225 | jb = jabber_buddy_find(js, from, TRUE); |
| 226 | ||
| 227 | js->pending_avatar_requests = g_slist_remove(js->pending_avatar_requests, jb); | |
| 228 | ||
| 10189 | 229 | if((vcard = xmlnode_get_child(packet, "vCard")) || |
| 230 | (vcard = xmlnode_get_child_with_namespace(packet, "query", "vcard-temp"))) { | |
| 10941 | 231 | if((photo = xmlnode_get_child(vcard, "PHOTO")) && |
| 11361 | 232 | (( (binval = xmlnode_get_child(photo, "BINVAL")) && |
| 233 | (text = xmlnode_get_data(binval))) || | |
| 234 | (text = xmlnode_get_data(photo)))) { | |
|
16534
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16018
diff
changeset
|
235 | unsigned char hashval[20]; |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16018
diff
changeset
|
236 | char hash[41], *p; |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16018
diff
changeset
|
237 | int i; |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16018
diff
changeset
|
238 | |
| 15884 | 239 | data = purple_base64_decode(text, &size); |
| 10189 | 240 | |
|
16534
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16018
diff
changeset
|
241 | purple_cipher_digest_region("sha1", data, size, |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16018
diff
changeset
|
242 | sizeof(hashval), hashval, NULL); |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16018
diff
changeset
|
243 | p = hash; |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16018
diff
changeset
|
244 | for(i=0; i<20; i++, p+=2) |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16018
diff
changeset
|
245 | snprintf(p, 3, "%02x", hashval[i]); |
| 10189 | 246 | |
|
16534
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16018
diff
changeset
|
247 | purple_buddy_icons_set_for_user(js->gc->account, from, data, size, hash); |
| 10941 | 248 | g_free(text); |
| 10189 | 249 | } |
| 250 | } | |
| 251 | } | |
| 252 | ||
| 7014 | 253 | void jabber_presence_parse(JabberStream *js, xmlnode *packet) |
| 254 | { | |
| 255 | const char *from = xmlnode_get_attrib(packet, "from"); | |
| 256 | const char *type = xmlnode_get_attrib(packet, "type"); | |
| 7944 | 257 | const char *real_jid = NULL; |
| 9152 | 258 | const char *affiliation = NULL; |
| 259 | const char *role = NULL; | |
| 7014 | 260 | char *status = NULL; |
| 261 | int priority = 0; | |
| 262 | JabberID *jid; | |
| 263 | JabberChat *chat; | |
| 264 | JabberBuddy *jb; | |
| 9954 | 265 | JabberBuddyResource *jbr = NULL, *found_jbr = NULL; |
| 15884 | 266 | PurpleConvChatBuddyFlags flags = PURPLE_CBFLAGS_NONE; |
|
9846
61f7349c153a
[gaim-migrate @ 10724]
Nathan Fredrickson <nathan@silverorange.com>
parents:
9745
diff
changeset
|
267 | gboolean delayed = FALSE; |
| 15884 | 268 | PurpleBuddy *b = NULL; |
| 7014 | 269 | char *buddy_name; |
| 9954 | 270 | JabberBuddyState state = JABBER_BUDDY_STATE_UNKNOWN; |
| 7014 | 271 | xmlnode *y; |
| 272 | gboolean muc = FALSE; | |
| 10189 | 273 | char *avatar_hash = NULL; |
| 7014 | 274 | |
| 8043 | 275 | if(!(jb = jabber_buddy_find(js, from, TRUE))) |
| 276 | return; | |
| 277 | ||
| 278 | if(!(jid = jabber_id_new(from))) | |
| 7280 | 279 | return; |
| 280 | ||
| 7014 | 281 | if(jb->error_msg) { |
| 282 | g_free(jb->error_msg); | |
| 283 | jb->error_msg = NULL; | |
| 284 | } | |
| 285 | ||
| 7813 | 286 | if(type && !strcmp(type, "error")) { |
| 8401 | 287 | char *msg = jabber_parse_error(js, packet); |
| 7644 | 288 | |
| 9954 | 289 | state = JABBER_BUDDY_STATE_ERROR; |
| 8401 | 290 | jb->error_msg = msg ? msg : g_strdup(_("Unknown Error in presence")); |
| 7813 | 291 | } else if(type && !strcmp(type, "subscribe")) { |
| 7014 | 292 | struct _jabber_add_permit *jap = g_new0(struct _jabber_add_permit, 1); |
| 15197 | 293 | gboolean onlist = FALSE; |
| 15884 | 294 | PurpleBuddy *buddy = purple_find_buddy(purple_connection_get_account(js->gc), from); |
| 15197 | 295 | JabberBuddy *jb = NULL; |
|
10949
b2949f5fc512
[gaim-migrate @ 12749]
Evan Schoenberg <evands@pidgin.im>
parents:
10941
diff
changeset
|
296 | |
| 15197 | 297 | if (buddy) { |
| 298 | jb = jabber_buddy_find(js, from, TRUE); | |
|
16018
0cbbb5b642ce
fix prompting to add a buddy after authorization if they're already on our list
Nathan Walp <nwalp@pidgin.im>
parents:
15952
diff
changeset
|
299 | if ((jb->subscription & JABBER_SUB_TO)) |
| 15197 | 300 | onlist = TRUE; |
| 301 | } | |
|
16018
0cbbb5b642ce
fix prompting to add a buddy after authorization if they're already on our list
Nathan Walp <nwalp@pidgin.im>
parents:
15952
diff
changeset
|
302 | |
| 7014 | 303 | jap->gc = js->gc; |
| 304 | jap->who = g_strdup(from); | |
| 12285 | 305 | jap->js = js; |
| 7014 | 306 | |
| 15884 | 307 | purple_account_request_authorization(purple_connection_get_account(js->gc), from, NULL, NULL, NULL, onlist, |
|
16018
0cbbb5b642ce
fix prompting to add a buddy after authorization if they're already on our list
Nathan Walp <nwalp@pidgin.im>
parents:
15952
diff
changeset
|
308 | G_CALLBACK(authorize_add_cb), G_CALLBACK(deny_add_cb), jap); |
| 8043 | 309 | jabber_id_free(jid); |
| 7145 | 310 | return; |
| 7813 | 311 | } else if(type && !strcmp(type, "subscribed")) { |
| 7014 | 312 | /* we've been allowed to see their presence, but we don't care */ |
| 8043 | 313 | jabber_id_free(jid); |
| 7014 | 314 | return; |
| 12285 | 315 | } else if(type && !strcmp(type, "unsubscribe")) { |
| 316 | /* XXX I'm not sure this is the right way to handle this, it | |
| 317 | * might be better to add "unsubscribe" to the presence status | |
| 318 | * if lower down, but I'm not sure. */ | |
| 319 | /* they are unsubscribing from our presence, we don't care */ | |
| 320 | /* Well, maybe just a little, we might want/need to start | |
| 321 | * acknowledging this (and the others) at some point. */ | |
| 322 | jabber_id_free(jid); | |
| 323 | return; | |
| 7014 | 324 | } else { |
| 325 | if((y = xmlnode_get_child(packet, "show"))) { | |
| 326 | char *show = xmlnode_get_data(y); | |
| 12683 | 327 | state = jabber_buddy_show_get_state(show); |
| 7014 | 328 | g_free(show); |
| 329 | } else { | |
| 9954 | 330 | state = JABBER_BUDDY_STATE_ONLINE; |
| 7014 | 331 | } |
| 332 | } | |
| 333 | ||
| 7310 | 334 | |
| 7014 | 335 | for(y = packet->child; y; y = y->next) { |
| 8135 | 336 | if(y->type != XMLNODE_TYPE_TAG) |
| 7014 | 337 | continue; |
| 338 | ||
| 339 | if(!strcmp(y->name, "status")) { | |
| 7615 | 340 | g_free(status); |
| 7014 | 341 | status = xmlnode_get_data(y); |
| 342 | } else if(!strcmp(y->name, "priority")) { | |
| 343 | char *p = xmlnode_get_data(y); | |
| 344 | if(p) { | |
| 345 | priority = atoi(p); | |
| 346 | g_free(p); | |
| 347 | } | |
| 348 | } else if(!strcmp(y->name, "x")) { | |
| 13808 | 349 | const char *xmlns = xmlnode_get_namespace(y); |
|
9846
61f7349c153a
[gaim-migrate @ 10724]
Nathan Fredrickson <nathan@silverorange.com>
parents:
9745
diff
changeset
|
350 | if(xmlns && !strcmp(xmlns, "jabber:x:delay")) { |
| 9847 | 351 | /* XXX: compare the time. jabber:x:delay can happen on presence packets that aren't really and truly delayed */ |
|
9846
61f7349c153a
[gaim-migrate @ 10724]
Nathan Fredrickson <nathan@silverorange.com>
parents:
9745
diff
changeset
|
352 | delayed = TRUE; |
|
61f7349c153a
[gaim-migrate @ 10724]
Nathan Fredrickson <nathan@silverorange.com>
parents:
9745
diff
changeset
|
353 | } else if(xmlns && !strcmp(xmlns, "http://jabber.org/protocol/muc#user")) { |
| 7629 | 354 | xmlnode *z; |
| 355 | ||
| 7014 | 356 | muc = TRUE; |
| 7629 | 357 | if((z = xmlnode_get_child(y, "status"))) { |
| 358 | const char *code = xmlnode_get_attrib(z, "code"); | |
| 359 | if(code && !strcmp(code, "201")) { | |
| 13445 | 360 | if((chat = jabber_chat_find(js, jid->node, jid->domain))) { |
| 15884 | 361 | chat->config_dialog_type = PURPLE_REQUEST_ACTION; |
| 13445 | 362 | chat->config_dialog_handle = |
| 15884 | 363 | purple_request_action(js->gc, |
| 13445 | 364 | _("Create New Room"), |
| 365 | _("Create New Room"), | |
| 366 | _("You are creating a new room. Would" | |
| 367 | " you like to configure it, or" | |
| 368 | " accept the default settings?"), | |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16018
diff
changeset
|
369 | /* Default Action */ 1, |
|
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16018
diff
changeset
|
370 | purple_connection_get_account(js->gc), NULL, chat->conv, |
|
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16018
diff
changeset
|
371 | chat, 2, |
|
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16018
diff
changeset
|
372 | _("_Configure Room"), G_CALLBACK(jabber_chat_request_room_configure), |
|
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16018
diff
changeset
|
373 | _("_Accept Defaults"), G_CALLBACK(jabber_chat_create_instant_room)); |
| 13445 | 374 | } |
|
18971
34b3eb14ea8f
Commit a patch by bibliochat to handle an XMPP MUC status code that I pushed
Etan Reisner <deryni@pidgin.im>
parents:
18382
diff
changeset
|
375 | } else if(code && !strcmp(code, "210")) { |
|
34b3eb14ea8f
Commit a patch by bibliochat to handle an XMPP MUC status code that I pushed
Etan Reisner <deryni@pidgin.im>
parents:
18382
diff
changeset
|
376 | /* server rewrote room-nick */ |
|
34b3eb14ea8f
Commit a patch by bibliochat to handle an XMPP MUC status code that I pushed
Etan Reisner <deryni@pidgin.im>
parents:
18382
diff
changeset
|
377 | if((chat = jabber_chat_find(js, jid->node, jid->domain))) { |
|
34b3eb14ea8f
Commit a patch by bibliochat to handle an XMPP MUC status code that I pushed
Etan Reisner <deryni@pidgin.im>
parents:
18382
diff
changeset
|
378 | g_free(chat->handle); |
|
34b3eb14ea8f
Commit a patch by bibliochat to handle an XMPP MUC status code that I pushed
Etan Reisner <deryni@pidgin.im>
parents:
18382
diff
changeset
|
379 | chat->handle = g_strdup(jid->resource); |
|
34b3eb14ea8f
Commit a patch by bibliochat to handle an XMPP MUC status code that I pushed
Etan Reisner <deryni@pidgin.im>
parents:
18382
diff
changeset
|
380 | } |
| 7629 | 381 | } |
| 382 | } | |
| 7944 | 383 | if((z = xmlnode_get_child(y, "item"))) { |
| 384 | real_jid = xmlnode_get_attrib(z, "jid"); | |
| 9152 | 385 | affiliation = xmlnode_get_attrib(z, "affiliation"); |
| 386 | role = xmlnode_get_attrib(z, "role"); | |
| 9931 | 387 | if(affiliation != NULL && !strcmp(affiliation, "owner")) |
| 15884 | 388 | flags |= PURPLE_CBFLAGS_FOUNDER; |
|
9743
839b2bce3853
[gaim-migrate @ 10608]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9559
diff
changeset
|
389 | if (role != NULL) { |
|
839b2bce3853
[gaim-migrate @ 10608]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9559
diff
changeset
|
390 | if (!strcmp(role, "moderator")) |
| 15884 | 391 | flags |= PURPLE_CBFLAGS_OP; |
|
9743
839b2bce3853
[gaim-migrate @ 10608]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9559
diff
changeset
|
392 | else if (!strcmp(role, "participant")) |
| 15884 | 393 | flags |= PURPLE_CBFLAGS_VOICE; |
|
9743
839b2bce3853
[gaim-migrate @ 10608]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9559
diff
changeset
|
394 | } |
| 7944 | 395 | } |
| 10189 | 396 | } else if(xmlns && !strcmp(xmlns, "vcard-temp:x:update")) { |
| 397 | xmlnode *photo = xmlnode_get_child(y, "photo"); | |
| 398 | if(photo) { | |
|
17702
15af85f94634
Don't check for null before calling free. I can't help but get rid
Mark Doliner <markdoliner@pidgin.im>
parents:
17683
diff
changeset
|
399 | g_free(avatar_hash); |
| 10189 | 400 | avatar_hash = xmlnode_get_data(photo); |
| 401 | } | |
| 7014 | 402 | } |
| 403 | } | |
| 404 | } | |
| 405 | ||
| 406 | ||
| 7322 | 407 | if(jid->node && (chat = jabber_chat_find(js, jid->node, jid->domain))) { |
| 8462 | 408 | static int i = 1; |
| 7014 | 409 | char *room_jid = g_strdup_printf("%s@%s", jid->node, jid->domain); |
| 410 | ||
| 17049 | 411 | if(state == JABBER_BUDDY_STATE_ERROR) { |
| 8401 | 412 | char *title, *msg = jabber_parse_error(js, packet); |
| 7014 | 413 | |
| 7321 | 414 | if(chat->conv) { |
| 8401 | 415 | title = g_strdup_printf(_("Error in chat %s"), from); |
|
18991
aa6a1feb874a
applied changes from 5542a465de12fedee4ebe7c124a754f9992d0d62
Mark Doliner <markdoliner@pidgin.im>
parents:
18989
diff
changeset
|
416 | if (g_hash_table_size(chat->members) == 0) |
|
aa6a1feb874a
applied changes from 5542a465de12fedee4ebe7c124a754f9992d0d62
Mark Doliner <markdoliner@pidgin.im>
parents:
18989
diff
changeset
|
417 | serv_got_chat_left(js->gc, chat->id); |
| 7321 | 418 | } else { |
| 8401 | 419 | title = g_strdup_printf(_("Error joining chat %s"), from); |
| 7321 | 420 | } |
| 15884 | 421 | purple_notify_error(js->gc, title, title, msg); |
| 8401 | 422 | g_free(title); |
| 423 | g_free(msg); | |
| 7014 | 424 | |
|
18991
aa6a1feb874a
applied changes from 5542a465de12fedee4ebe7c124a754f9992d0d62
Mark Doliner <markdoliner@pidgin.im>
parents:
18989
diff
changeset
|
425 | if (g_hash_table_size(chat->members) == 0) |
|
aa6a1feb874a
applied changes from 5542a465de12fedee4ebe7c124a754f9992d0d62
Mark Doliner <markdoliner@pidgin.im>
parents:
18989
diff
changeset
|
426 | /* Only destroy the chat if the error happened while joining */ |
|
aa6a1feb874a
applied changes from 5542a465de12fedee4ebe7c124a754f9992d0d62
Mark Doliner <markdoliner@pidgin.im>
parents:
18989
diff
changeset
|
427 | jabber_chat_destroy(chat); |
| 7310 | 428 | jabber_id_free(jid); |
| 7615 | 429 | g_free(status); |
| 8182 | 430 | g_free(room_jid); |
|
17702
15af85f94634
Don't check for null before calling free. I can't help but get rid
Mark Doliner <markdoliner@pidgin.im>
parents:
17683
diff
changeset
|
431 | g_free(avatar_hash); |
| 7014 | 432 | return; |
| 433 | } | |
| 434 | ||
| 435 | ||
| 7813 | 436 | if(type && !strcmp(type, "unavailable")) { |
| 7972 | 437 | gboolean nick_change = FALSE; |
| 7973 | 438 | |
| 9152 | 439 | /* If we haven't joined the chat yet, we don't care that someone |
| 440 | * left, or it was us leaving after we closed the chat */ | |
| 8182 | 441 | if(!chat->conv) { |
| 10558 | 442 | if(jid->resource && chat->handle && !strcmp(jid->resource, chat->handle)) |
| 9152 | 443 | jabber_chat_destroy(chat); |
| 8182 | 444 | jabber_id_free(jid); |
| 445 | g_free(status); | |
| 446 | g_free(room_jid); | |
|
17702
15af85f94634
Don't check for null before calling free. I can't help but get rid
Mark Doliner <markdoliner@pidgin.im>
parents:
17683
diff
changeset
|
447 | g_free(avatar_hash); |
| 8182 | 448 | return; |
| 449 | } | |
| 450 | ||
| 7973 | 451 | jabber_buddy_remove_resource(jb, jid->resource); |
| 7972 | 452 | if(chat->muc) { |
| 453 | xmlnode *x; | |
| 8135 | 454 | for(x = xmlnode_get_child(packet, "x"); x; x = xmlnode_get_next_twin(x)) { |
| 7972 | 455 | const char *xmlns, *nick, *code; |
| 456 | xmlnode *stat, *item; | |
| 13808 | 457 | if(!(xmlns = xmlnode_get_namespace(x)) || |
| 7972 | 458 | strcmp(xmlns, "http://jabber.org/protocol/muc#user")) |
| 459 | continue; | |
| 460 | if(!(stat = xmlnode_get_child(x, "status"))) | |
| 461 | continue; | |
| 9152 | 462 | if(!(code = xmlnode_get_attrib(stat, "code"))) |
| 7972 | 463 | continue; |
| 9152 | 464 | if(!strcmp(code, "301")) { |
| 465 | /* XXX: we got banned */ | |
| 466 | } else if(!strcmp(code, "303")) { | |
| 467 | if(!(item = xmlnode_get_child(x, "item"))) | |
| 468 | continue; | |
| 469 | if(!(nick = xmlnode_get_attrib(item, "nick"))) | |
| 470 | continue; | |
| 471 | nick_change = TRUE; | |
| 472 | if(!strcmp(jid->resource, chat->handle)) { | |
| 473 | g_free(chat->handle); | |
| 474 | chat->handle = g_strdup(nick); | |
| 475 | } | |
| 15884 | 476 | purple_conv_chat_rename_user(PURPLE_CONV_CHAT(chat->conv), jid->resource, nick); |
| 9152 | 477 | jabber_chat_remove_handle(chat, jid->resource); |
| 478 | break; | |
| 479 | } else if(!strcmp(code, "307")) { | |
| 480 | /* XXX: we got kicked */ | |
| 481 | } else if(!strcmp(code, "321")) { | |
| 482 | /* XXX: removed due to an affiliation change */ | |
| 483 | } else if(!strcmp(code, "322")) { | |
| 484 | /* XXX: removed because room is now members-only */ | |
| 485 | } else if(!strcmp(code, "332")) { | |
| 486 | /* XXX: removed due to system shutdown */ | |
| 8401 | 487 | } |
| 7972 | 488 | } |
| 489 | } | |
| 490 | if(!nick_change) { | |
| 9152 | 491 | if(!g_utf8_collate(jid->resource, chat->handle)) { |
| 7972 | 492 | serv_got_chat_left(js->gc, chat->id); |
| 493 | jabber_chat_destroy(chat); | |
| 494 | } else { | |
| 15884 | 495 | purple_conv_chat_remove_user(PURPLE_CONV_CHAT(chat->conv), jid->resource, |
| 7974 | 496 | status); |
| 9152 | 497 | jabber_chat_remove_handle(chat, jid->resource); |
| 7972 | 498 | } |
| 7014 | 499 | } |
| 500 | } else { | |
| 8182 | 501 | if(!chat->conv) { |
| 502 | chat->id = i++; | |
| 503 | chat->muc = muc; | |
| 504 | chat->conv = serv_got_joined_chat(js->gc, chat->id, room_jid); | |
| 15884 | 505 | purple_conv_chat_set_nick(PURPLE_CONV_CHAT(chat->conv), chat->handle); |
| 10486 | 506 | |
| 10941 | 507 | jabber_chat_disco_traffic(chat); |
| 8182 | 508 | } |
| 509 | ||
| 7973 | 510 | jabber_buddy_track_resource(jb, jid->resource, priority, state, |
| 511 | status); | |
| 512 | ||
| 9152 | 513 | jabber_chat_track_handle(chat, jid->resource, real_jid, affiliation, role); |
| 514 | ||
| 7014 | 515 | if(!jabber_chat_find_buddy(chat->conv, jid->resource)) |
| 15884 | 516 | purple_conv_chat_add_user(PURPLE_CONV_CHAT(chat->conv), jid->resource, |
|
9846
61f7349c153a
[gaim-migrate @ 10724]
Nathan Fredrickson <nathan@silverorange.com>
parents:
9745
diff
changeset
|
517 | real_jid, flags, !delayed); |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9320
diff
changeset
|
518 | else |
| 15884 | 519 | purple_conv_chat_user_set_flags(PURPLE_CONV_CHAT(chat->conv), jid->resource, |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9320
diff
changeset
|
520 | flags); |
| 7014 | 521 | } |
| 522 | g_free(room_jid); | |
| 523 | } else { | |
| 7322 | 524 | buddy_name = g_strdup_printf("%s%s%s", jid->node ? jid->node : "", |
| 525 | jid->node ? "@" : "", jid->domain); | |
| 15884 | 526 | if((b = purple_find_buddy(js->gc->account, buddy_name)) == NULL) { |
|
18310
dbc5240f6bf5
Fix a crash when you have an IM window open on a jabber account and the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18226
diff
changeset
|
527 | purple_debug_warning("jabber", "Got presence for unknown buddy %s on account %s (%x)\n", |
| 15884 | 528 | buddy_name, purple_account_get_username(js->gc->account), js->gc->account); |
| 7014 | 529 | jabber_id_free(jid); |
| 17703 | 530 | g_free(avatar_hash); |
| 7014 | 531 | g_free(buddy_name); |
| 7615 | 532 | g_free(status); |
| 7014 | 533 | return; |
| 534 | } | |
| 535 | ||
| 10189 | 536 | if(avatar_hash) { |
|
16534
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16018
diff
changeset
|
537 | const char *avatar_hash2 = purple_buddy_icons_get_checksum_for_user(b); |
| 10189 | 538 | if(!avatar_hash2 || strcmp(avatar_hash, avatar_hash2)) { |
| 539 | JabberIq *iq; | |
| 540 | xmlnode *vcard; | |
| 541 | ||
| 10941 | 542 | /* XXX this is a crappy way of trying to prevent |
| 543 | * someone from spamming us with presence packets | |
| 544 | * and causing us to DoS ourselves...what we really | |
| 545 | * need is a queue system that can throttle itself, | |
| 546 | * but i'm too tired to write that right now */ | |
| 547 | if(!g_slist_find(js->pending_avatar_requests, jb)) { | |
| 548 | ||
| 549 | js->pending_avatar_requests = g_slist_prepend(js->pending_avatar_requests, jb); | |
| 10189 | 550 | |
| 10941 | 551 | iq = jabber_iq_new(js, JABBER_IQ_GET); |
| 552 | xmlnode_set_attrib(iq->node, "to", buddy_name); | |
| 553 | vcard = xmlnode_new_child(iq->node, "vCard"); | |
| 13808 | 554 | xmlnode_set_namespace(vcard, "vcard-temp"); |
| 10941 | 555 | |
| 556 | jabber_iq_set_callback(iq, jabber_vcard_parse_avatar, NULL); | |
| 557 | jabber_iq_send(iq); | |
| 558 | } | |
| 10189 | 559 | } |
| 560 | } | |
| 561 | ||
| 9954 | 562 | if(state == JABBER_BUDDY_STATE_ERROR || |
| 7813 | 563 | (type && (!strcmp(type, "unavailable") || |
| 564 | !strcmp(type, "unsubscribed")))) { | |
| 15884 | 565 | PurpleConversation *conv; |
| 8043 | 566 | |
| 7014 | 567 | jabber_buddy_remove_resource(jb, jid->resource); |
| 8043 | 568 | if((conv = jabber_find_unnormalized_conv(from, js->gc->account))) |
| 15884 | 569 | purple_conversation_set_name(conv, buddy_name); |
| 8043 | 570 | |
| 7395 | 571 | } else { |
| 9954 | 572 | jbr = jabber_buddy_track_resource(jb, jid->resource, priority, |
| 573 | state, status); | |
| 7395 | 574 | } |
| 7014 | 575 | |
| 9954 | 576 | if((found_jbr = jabber_buddy_find_resource(jb, NULL))) { |
|
18366
6a0ad943967f
When an XMPP buddy signs off, show the status of the currently highest priority buddy, rather than the status of the signed off buddy. Fixes #1126
Sean Egan <seanegan@pidgin.im>
parents:
18330
diff
changeset
|
577 | purple_prpl_got_user_status(js->gc->account, buddy_name, jabber_buddy_state_get_status_id(found_jbr->state), "priority", found_jbr->priority, found_jbr->status ? "message" : NULL, found_jbr->status, NULL); |
| 9954 | 578 | } else { |
| 15884 | 579 | purple_prpl_got_user_status(js->gc->account, buddy_name, "offline", status ? "message" : NULL, status, NULL); |
| 9954 | 580 | } |
| 7014 | 581 | g_free(buddy_name); |
| 582 | } | |
| 583 | g_free(status); | |
| 584 | jabber_id_free(jid); | |
|
17702
15af85f94634
Don't check for null before calling free. I can't help but get rid
Mark Doliner <markdoliner@pidgin.im>
parents:
17683
diff
changeset
|
585 | g_free(avatar_hash); |
| 7014 | 586 | } |
| 587 | ||
| 588 | void jabber_presence_subscription_set(JabberStream *js, const char *who, const char *type) | |
| 589 | { | |
| 590 | xmlnode *presence = xmlnode_new("presence"); | |
| 591 | ||
| 592 | xmlnode_set_attrib(presence, "to", who); | |
| 593 | xmlnode_set_attrib(presence, "type", type); | |
| 594 | ||
| 595 | jabber_send(js, presence); | |
| 596 | xmlnode_free(presence); | |
| 597 | } | |
| 9954 | 598 | |
| 15884 | 599 | void purple_status_to_jabber(const PurpleStatus *status, JabberBuddyState *state, char **msg, int *priority) |
| 9954 | 600 | { |
| 10216 | 601 | const char *status_id = NULL; |
| 14525 | 602 | const char *formatted_msg = NULL; |
| 10216 | 603 | |
| 13443 | 604 | if(state) *state = JABBER_BUDDY_STATE_UNKNOWN; |
| 605 | if(msg) *msg = NULL; | |
| 606 | if(priority) *priority = 0; | |
| 9954 | 607 | |
| 608 | if(!status) { | |
| 13443 | 609 | if(state) *state = JABBER_BUDDY_STATE_UNAVAILABLE; |
| 10216 | 610 | } else { |
| 611 | if(state) { | |
| 15884 | 612 | status_id = purple_status_get_id(status); |
| 10216 | 613 | *state = jabber_buddy_status_id_get_state(status_id); |
| 614 | } | |
| 615 | ||
|
13497
07fc0a9826b8
[gaim-migrate @ 15872]
Richard Laager <rlaager@pidgin.im>
parents:
13445
diff
changeset
|
616 | if(msg) { |
| 15884 | 617 | formatted_msg = purple_status_get_attr_string(status, "message"); |
| 10216 | 618 | |
|
13497
07fc0a9826b8
[gaim-migrate @ 15872]
Richard Laager <rlaager@pidgin.im>
parents:
13445
diff
changeset
|
619 | /* if the message is blank, then there really isn't a message */ |
| 14525 | 620 | if(formatted_msg && !*formatted_msg) |
| 621 | formatted_msg = NULL; | |
| 622 | ||
| 623 | if(formatted_msg) | |
| 17683 | 624 | *msg = purple_markup_strip_html(formatted_msg); |
|
13497
07fc0a9826b8
[gaim-migrate @ 15872]
Richard Laager <rlaager@pidgin.im>
parents:
13445
diff
changeset
|
625 | } |
| 11872 | 626 | |
| 10216 | 627 | if(priority) |
| 15884 | 628 | *priority = purple_status_get_attr_int(status, "priority"); |
| 9954 | 629 | } |
| 630 | } |