Mercurial > pidgin
annotate libpurple/protocols/jabber/roster.c @ 30882:c0337902d62a
This function is now in slp.h, it doesnt need to be here.
author | masca@cpw.pidgin.im |
---|---|
date | Wed, 22 Sep 2010 20:58:43 +0000 |
parents | 25e200cb3532 |
children | 06ed9020b784 |
rev | line source |
---|---|
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1 /* |
15822 | 2 * purple - Jabber Protocol Plugin |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3 * |
28048
c585572e80dd
Remove specific copyright lines from the XMPP prpl.
Paul Aurich <paul@darkrain42.org>
parents:
27794
diff
changeset
|
4 * Purple is the legal property of its developers, whose names are too numerous |
c585572e80dd
Remove specific copyright lines from the XMPP prpl.
Paul Aurich <paul@darkrain42.org>
parents:
27794
diff
changeset
|
5 * to list here. Please refer to the COPYRIGHT file distributed with this |
c585572e80dd
Remove specific copyright lines from the XMPP prpl.
Paul Aurich <paul@darkrain42.org>
parents:
27794
diff
changeset
|
6 * source distribution. |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8 * This program is free software; you can redistribute it and/or modify |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
9 * it under the terms of the GNU General Public License as published by |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
10 * the Free Software Foundation; either version 2 of the License, or |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
11 * (at your option) any later version. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
12 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
13 * This program is distributed in the hope that it will be useful, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
16 * GNU General Public License for more details. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
17 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
18 * You should have received a copy of the GNU General Public License |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
19 * along with this program; if not, write to the Free Software |
19681
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19455
diff
changeset
|
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
21 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
22 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
23 #include "internal.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
24 #include "debug.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
25 #include "server.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
26 #include "util.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
27 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
28 #include "buddy.h" |
28150
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
29 #include "chat.h" |
30472
ae615b3d3e47
First shot at refactoring the Google-specific XMPP code.
Marcus Lundblad <ml@update.uu.se>
parents:
29050
diff
changeset
|
30 #include "google/google.h" |
ae615b3d3e47
First shot at refactoring the Google-specific XMPP code.
Marcus Lundblad <ml@update.uu.se>
parents:
29050
diff
changeset
|
31 #include "google/google_roster.h" |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
32 #include "presence.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
33 #include "roster.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
34 #include "iq.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
35 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
36 #include <string.h> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
37 |
27499
efb40ca43589
Debug output when changing group memberships.
Paul Aurich <paul@darkrain42.org>
parents:
27498
diff
changeset
|
38 /* Take a list of strings and join them with a ", " separator */ |
efb40ca43589
Debug output when changing group memberships.
Paul Aurich <paul@darkrain42.org>
parents:
27498
diff
changeset
|
39 static gchar *roster_groups_join(GSList *list) |
efb40ca43589
Debug output when changing group memberships.
Paul Aurich <paul@darkrain42.org>
parents:
27498
diff
changeset
|
40 { |
efb40ca43589
Debug output when changing group memberships.
Paul Aurich <paul@darkrain42.org>
parents:
27498
diff
changeset
|
41 GString *out = g_string_new(NULL); |
efb40ca43589
Debug output when changing group memberships.
Paul Aurich <paul@darkrain42.org>
parents:
27498
diff
changeset
|
42 for ( ; list; list = list->next) { |
efb40ca43589
Debug output when changing group memberships.
Paul Aurich <paul@darkrain42.org>
parents:
27498
diff
changeset
|
43 out = g_string_append(out, (const char *)list->data); |
efb40ca43589
Debug output when changing group memberships.
Paul Aurich <paul@darkrain42.org>
parents:
27498
diff
changeset
|
44 if (list->next) |
efb40ca43589
Debug output when changing group memberships.
Paul Aurich <paul@darkrain42.org>
parents:
27498
diff
changeset
|
45 out = g_string_append(out, ", "); |
efb40ca43589
Debug output when changing group memberships.
Paul Aurich <paul@darkrain42.org>
parents:
27498
diff
changeset
|
46 } |
efb40ca43589
Debug output when changing group memberships.
Paul Aurich <paul@darkrain42.org>
parents:
27498
diff
changeset
|
47 |
efb40ca43589
Debug output when changing group memberships.
Paul Aurich <paul@darkrain42.org>
parents:
27498
diff
changeset
|
48 return g_string_free(out, FALSE); |
efb40ca43589
Debug output when changing group memberships.
Paul Aurich <paul@darkrain42.org>
parents:
27498
diff
changeset
|
49 } |
efb40ca43589
Debug output when changing group memberships.
Paul Aurich <paul@darkrain42.org>
parents:
27498
diff
changeset
|
50 |
28760
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
51 static void roster_request_cb(JabberStream *js, const char *from, |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
52 JabberIqType type, const char *id, |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
53 xmlnode *packet, gpointer data) |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
54 { |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
55 xmlnode *query; |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
56 |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
57 if (type == JABBER_IQ_ERROR) { |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
58 /* |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
59 * This shouldn't happen in any real circumstances and |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
60 * likely constitutes a server-side misconfiguration (i.e. |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
61 * explicitly not loading mod_roster...) |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
62 */ |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
63 purple_debug_error("jabber", "Error retrieving roster!?\n"); |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
64 jabber_stream_set_state(js, JABBER_STREAM_CONNECTED); |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
65 return; |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
66 } |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
67 |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
68 query = xmlnode_get_child(packet, "query"); |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
69 if (query == NULL) { |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
70 jabber_stream_set_state(js, JABBER_STREAM_CONNECTED); |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
71 return; |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
72 } |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
73 |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
74 jabber_roster_parse(js, from, type, id, query); |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
75 jabber_stream_set_state(js, JABBER_STREAM_CONNECTED); |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
76 } |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
77 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
78 void jabber_roster_request(JabberStream *js) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
79 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
80 JabberIq *iq; |
28760
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
81 xmlnode *query; |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
82 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
83 iq = jabber_iq_new_query(js, JABBER_IQ_GET, "jabber:iq:roster"); |
28760
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
84 query = xmlnode_get_child(iq->node, "query"); |
28767
9ab75ab032b4
jabber: The google roster request code was so lonely, so let's just drop-kick it and add the little custom logic to roster.c
Paul Aurich <paul@darkrain42.org>
parents:
28760
diff
changeset
|
85 |
9ab75ab032b4
jabber: The google roster request code was so lonely, so let's just drop-kick it and add the little custom logic to roster.c
Paul Aurich <paul@darkrain42.org>
parents:
28760
diff
changeset
|
86 if (js->server_caps & JABBER_CAP_GOOGLE_ROSTER) { |
9ab75ab032b4
jabber: The google roster request code was so lonely, so let's just drop-kick it and add the little custom logic to roster.c
Paul Aurich <paul@darkrain42.org>
parents:
28760
diff
changeset
|
87 xmlnode_set_attrib(query, "xmlns:gr", NS_GOOGLE_ROSTER); |
9ab75ab032b4
jabber: The google roster request code was so lonely, so let's just drop-kick it and add the little custom logic to roster.c
Paul Aurich <paul@darkrain42.org>
parents:
28760
diff
changeset
|
88 xmlnode_set_attrib(query, "gr:ext", "2"); |
9ab75ab032b4
jabber: The google roster request code was so lonely, so let's just drop-kick it and add the little custom logic to roster.c
Paul Aurich <paul@darkrain42.org>
parents:
28760
diff
changeset
|
89 } |
9ab75ab032b4
jabber: The google roster request code was so lonely, so let's just drop-kick it and add the little custom logic to roster.c
Paul Aurich <paul@darkrain42.org>
parents:
28760
diff
changeset
|
90 |
28760
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
91 jabber_iq_set_callback(iq, roster_request_cb, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
92 jabber_iq_send(iq); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
93 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
94 |
15822 | 95 static void remove_purple_buddies(JabberStream *js, const char *jid) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
96 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
97 GSList *buddies, *l; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
98 |
15822 | 99 buddies = purple_find_buddies(js->gc->account, jid); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
100 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
101 for(l = buddies; l; l = l->next) |
15822 | 102 purple_blist_remove_buddy(l->data); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
103 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
104 g_slist_free(buddies); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
105 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
106 |
27494
93a41017dca9
Various roster cleanups. Refs #7008.
Paul Aurich <paul@darkrain42.org>
parents:
27493
diff
changeset
|
107 static void add_purple_buddy_to_groups(JabberStream *js, const char *jid, |
27794
eb2d17945ce3
jabber: Store the "own JabberBuddy" in the JabberStream* struct.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
108 const char *alias, GSList *groups) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
109 { |
27494
93a41017dca9
Various roster cleanups. Refs #7008.
Paul Aurich <paul@darkrain42.org>
parents:
27493
diff
changeset
|
110 GSList *buddies, *l; |
28436
05867b153f03
jabber: Remove the roster pool stuff.
Paul Aurich <paul@darkrain42.org>
parents:
28326
diff
changeset
|
111 PurpleAccount *account = purple_connection_get_account(js->gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
112 |
15822 | 113 buddies = purple_find_buddies(js->gc->account, jid); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
114 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
115 if(!groups) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
116 if(!buddies) |
27494
93a41017dca9
Various roster cleanups. Refs #7008.
Paul Aurich <paul@darkrain42.org>
parents:
27493
diff
changeset
|
117 groups = g_slist_append(groups, g_strdup(_("Buddies"))); |
20329
24ce4fcce5b0
applied changes from e56db1b8a7bb8729e30fb3bf99a94ff7887fe4ec
Luke Schierer <lschiere@pidgin.im>
parents:
19681
diff
changeset
|
118 else { |
27494
93a41017dca9
Various roster cleanups. Refs #7008.
Paul Aurich <paul@darkrain42.org>
parents:
27493
diff
changeset
|
119 /* TODO: What should we do here? Removing the local buddies |
93a41017dca9
Various roster cleanups. Refs #7008.
Paul Aurich <paul@darkrain42.org>
parents:
27493
diff
changeset
|
120 * is wrong, but so is letting the group state get out of sync with |
93a41017dca9
Various roster cleanups. Refs #7008.
Paul Aurich <paul@darkrain42.org>
parents:
27493
diff
changeset
|
121 * the server. |
93a41017dca9
Various roster cleanups. Refs #7008.
Paul Aurich <paul@darkrain42.org>
parents:
27493
diff
changeset
|
122 */ |
20329
24ce4fcce5b0
applied changes from e56db1b8a7bb8729e30fb3bf99a94ff7887fe4ec
Luke Schierer <lschiere@pidgin.im>
parents:
19681
diff
changeset
|
123 g_slist_free(buddies); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
124 return; |
20329
24ce4fcce5b0
applied changes from e56db1b8a7bb8729e30fb3bf99a94ff7887fe4ec
Luke Schierer <lschiere@pidgin.im>
parents:
19681
diff
changeset
|
125 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
126 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
127 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
128 while(buddies) { |
15822 | 129 PurpleBuddy *b = buddies->data; |
130 PurpleGroup *g = purple_buddy_get_group(b); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
131 |
27494
93a41017dca9
Various roster cleanups. Refs #7008.
Paul Aurich <paul@darkrain42.org>
parents:
27493
diff
changeset
|
132 buddies = g_slist_delete_link(buddies, buddies); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
133 |
27494
93a41017dca9
Various roster cleanups. Refs #7008.
Paul Aurich <paul@darkrain42.org>
parents:
27493
diff
changeset
|
134 /* XMPP groups are case-sensitive, but libpurple groups are |
93a41017dca9
Various roster cleanups. Refs #7008.
Paul Aurich <paul@darkrain42.org>
parents:
27493
diff
changeset
|
135 * case-insensitive. We treat a buddy in both "Friends" and "friends" |
27505
1638786071af
Clarify a comment a little.
Paul Aurich <paul@darkrain42.org>
parents:
27504
diff
changeset
|
136 * as only being in one group, but if we push changes about the buddy |
27494
93a41017dca9
Various roster cleanups. Refs #7008.
Paul Aurich <paul@darkrain42.org>
parents:
27493
diff
changeset
|
137 * to the server, the buddy will be dropped from one of the groups. |
27505
1638786071af
Clarify a comment a little.
Paul Aurich <paul@darkrain42.org>
parents:
27504
diff
changeset
|
138 * Not optimal, but better than the alternative, I think. |
27494
93a41017dca9
Various roster cleanups. Refs #7008.
Paul Aurich <paul@darkrain42.org>
parents:
27493
diff
changeset
|
139 */ |
93a41017dca9
Various roster cleanups. Refs #7008.
Paul Aurich <paul@darkrain42.org>
parents:
27493
diff
changeset
|
140 if((l = g_slist_find_custom(groups, purple_group_get_name(g), (GCompareFunc)purple_utf8_strcasecmp))) { |
93a41017dca9
Various roster cleanups. Refs #7008.
Paul Aurich <paul@darkrain42.org>
parents:
27493
diff
changeset
|
141 /* The buddy is already on the local list. Update info. */ |
25803
8aa7d8bcbc7d
Alias foo. I think blist.h structs are now completely hidden.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25130
diff
changeset
|
142 const char *servernick, *balias; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
143 |
24002
5e51360bb22c
The alias we retrieve from the roster is a private alias; use purple_serv_got_private_alias() to tell the core about it
Evan Schoenberg <evan.s@dreskin.net>
parents:
23648
diff
changeset
|
144 /* Previously stored serverside / buddy-supplied alias */ |
15822 | 145 if((servernick = purple_blist_node_get_string((PurpleBlistNode*)b, "servernick"))) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
146 serv_got_alias(js->gc, jid, servernick); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
147 |
24002
5e51360bb22c
The alias we retrieve from the roster is a private alias; use purple_serv_got_private_alias() to tell the core about it
Evan Schoenberg <evan.s@dreskin.net>
parents:
23648
diff
changeset
|
148 /* Alias from our roster retrieval */ |
25803
8aa7d8bcbc7d
Alias foo. I think blist.h structs are now completely hidden.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25130
diff
changeset
|
149 balias = purple_buddy_get_local_buddy_alias(b); |
27494
93a41017dca9
Various roster cleanups. Refs #7008.
Paul Aurich <paul@darkrain42.org>
parents:
27493
diff
changeset
|
150 if(alias && !purple_strequal(alias, balias)) |
24002
5e51360bb22c
The alias we retrieve from the roster is a private alias; use purple_serv_got_private_alias() to tell the core about it
Evan Schoenberg <evan.s@dreskin.net>
parents:
23648
diff
changeset
|
151 purple_serv_got_private_alias(js->gc, jid, alias); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
152 g_free(l->data); |
27494
93a41017dca9
Various roster cleanups. Refs #7008.
Paul Aurich <paul@darkrain42.org>
parents:
27493
diff
changeset
|
153 groups = g_slist_delete_link(groups, l); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
154 } else { |
27494
93a41017dca9
Various roster cleanups. Refs #7008.
Paul Aurich <paul@darkrain42.org>
parents:
27493
diff
changeset
|
155 /* This buddy isn't in the group on the server anymore */ |
28436
05867b153f03
jabber: Remove the roster pool stuff.
Paul Aurich <paul@darkrain42.org>
parents:
28326
diff
changeset
|
156 purple_debug_info("jabber", "jabber_roster_parse(): Removing %s " |
05867b153f03
jabber: Remove the roster pool stuff.
Paul Aurich <paul@darkrain42.org>
parents:
28326
diff
changeset
|
157 "from group '%s' on the local list\n", |
05867b153f03
jabber: Remove the roster pool stuff.
Paul Aurich <paul@darkrain42.org>
parents:
28326
diff
changeset
|
158 purple_buddy_get_name(b), |
05867b153f03
jabber: Remove the roster pool stuff.
Paul Aurich <paul@darkrain42.org>
parents:
28326
diff
changeset
|
159 purple_group_get_name(g)); |
05867b153f03
jabber: Remove the roster pool stuff.
Paul Aurich <paul@darkrain42.org>
parents:
28326
diff
changeset
|
160 purple_blist_remove_buddy(b); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
161 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
162 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
163 |
27499
efb40ca43589
Debug output when changing group memberships.
Paul Aurich <paul@darkrain42.org>
parents:
27498
diff
changeset
|
164 if (groups) { |
efb40ca43589
Debug output when changing group memberships.
Paul Aurich <paul@darkrain42.org>
parents:
27498
diff
changeset
|
165 char *tmp = roster_groups_join(groups); |
efb40ca43589
Debug output when changing group memberships.
Paul Aurich <paul@darkrain42.org>
parents:
27498
diff
changeset
|
166 purple_debug_info("jabber", "jabber_roster_parse(): Adding %s to " |
efb40ca43589
Debug output when changing group memberships.
Paul Aurich <paul@darkrain42.org>
parents:
27498
diff
changeset
|
167 "groups: %s\n", jid, tmp); |
efb40ca43589
Debug output when changing group memberships.
Paul Aurich <paul@darkrain42.org>
parents:
27498
diff
changeset
|
168 g_free(tmp); |
efb40ca43589
Debug output when changing group memberships.
Paul Aurich <paul@darkrain42.org>
parents:
27498
diff
changeset
|
169 } |
efb40ca43589
Debug output when changing group memberships.
Paul Aurich <paul@darkrain42.org>
parents:
27498
diff
changeset
|
170 |
27494
93a41017dca9
Various roster cleanups. Refs #7008.
Paul Aurich <paul@darkrain42.org>
parents:
27493
diff
changeset
|
171 while(groups) { |
93a41017dca9
Various roster cleanups. Refs #7008.
Paul Aurich <paul@darkrain42.org>
parents:
27493
diff
changeset
|
172 PurpleGroup *g = purple_find_group(groups->data); |
28436
05867b153f03
jabber: Remove the roster pool stuff.
Paul Aurich <paul@darkrain42.org>
parents:
28326
diff
changeset
|
173 PurpleBuddy *b = purple_buddy_new(account, jid, alias); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
174 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
175 if(!g) { |
27494
93a41017dca9
Various roster cleanups. Refs #7008.
Paul Aurich <paul@darkrain42.org>
parents:
27493
diff
changeset
|
176 g = purple_group_new(groups->data); |
15822 | 177 purple_blist_add_group(g, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
178 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
179 |
15822 | 180 purple_blist_add_buddy(b, NULL, g, NULL); |
181 purple_blist_alias_buddy(b, alias); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
182 |
27494
93a41017dca9
Various roster cleanups. Refs #7008.
Paul Aurich <paul@darkrain42.org>
parents:
27493
diff
changeset
|
183 g_free(groups->data); |
93a41017dca9
Various roster cleanups. Refs #7008.
Paul Aurich <paul@darkrain42.org>
parents:
27493
diff
changeset
|
184 groups = g_slist_delete_link(groups, groups); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
185 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
186 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
187 g_slist_free(buddies); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
188 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
189 |
25648
050052891c55
Pass IQ handlers type, from, id, and the child node
Paul Aurich <paul@darkrain42.org>
parents:
24451
diff
changeset
|
190 void jabber_roster_parse(JabberStream *js, const char *from, |
050052891c55
Pass IQ handlers type, from, id, and the child node
Paul Aurich <paul@darkrain42.org>
parents:
24451
diff
changeset
|
191 JabberIqType type, const char *id, xmlnode *query) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
192 { |
25648
050052891c55
Pass IQ handlers type, from, id, and the child node
Paul Aurich <paul@darkrain42.org>
parents:
24451
diff
changeset
|
193 xmlnode *item, *group; |
28848
2f64bfb21c0d
Disable this part of roster versioning, too (for now). Refs #10935.
Paul Aurich <paul@darkrain42.org>
parents:
28780
diff
changeset
|
194 #if 0 |
28760
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
195 const char *ver; |
28848
2f64bfb21c0d
Disable this part of roster versioning, too (for now). Refs #10935.
Paul Aurich <paul@darkrain42.org>
parents:
28780
diff
changeset
|
196 #endif |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
197 |
27492
ff099a916d6b
Use jabber_is_own_account and perform way fewer normalizations per iteration
Paul Aurich <paul@darkrain42.org>
parents:
27023
diff
changeset
|
198 if (!jabber_is_own_account(js, from)) { |
ff099a916d6b
Use jabber_is_own_account and perform way fewer normalizations per iteration
Paul Aurich <paul@darkrain42.org>
parents:
27023
diff
changeset
|
199 purple_debug_warning("jabber", "Received bogon roster push from %s\n", |
ff099a916d6b
Use jabber_is_own_account and perform way fewer normalizations per iteration
Paul Aurich <paul@darkrain42.org>
parents:
27023
diff
changeset
|
200 from); |
ff099a916d6b
Use jabber_is_own_account and perform way fewer normalizations per iteration
Paul Aurich <paul@darkrain42.org>
parents:
27023
diff
changeset
|
201 return; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
202 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
203 |
23648
9bf36aad8735
We talked about this and decided it was probably cleaner to not use
Mark Doliner <mark@kingant.net>
parents:
23646
diff
changeset
|
204 js->currently_parsing_roster_push = TRUE; |
23646
c31dfae66134
Hopefully fix the XMPP contact flipping/swapping between groups bug
Mark Doliner <mark@kingant.net>
parents:
23423
diff
changeset
|
205 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
206 for(item = xmlnode_get_child(query, "item"); item; item = xmlnode_get_next_twin(item)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
207 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
208 const char *jid, *name, *subscription, *ask; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
209 JabberBuddy *jb; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
210 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
211 subscription = xmlnode_get_attrib(item, "subscription"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
212 jid = xmlnode_get_attrib(item, "jid"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
213 name = xmlnode_get_attrib(item, "name"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
214 ask = xmlnode_get_attrib(item, "ask"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
215 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
216 if(!jid) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
217 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
218 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
219 if(!(jb = jabber_buddy_find(js, jid, TRUE))) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
220 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
221 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
222 if(subscription) { |
28778
7c543cbf52c0
jabber: Fix removing a self-contact.
Paul Aurich <paul@darkrain42.org>
parents:
28767
diff
changeset
|
223 if (g_str_equal(subscription, "remove")) |
7c543cbf52c0
jabber: Fix removing a self-contact.
Paul Aurich <paul@darkrain42.org>
parents:
28767
diff
changeset
|
224 jb->subscription = JABBER_SUB_REMOVE; |
7c543cbf52c0
jabber: Fix removing a self-contact.
Paul Aurich <paul@darkrain42.org>
parents:
28767
diff
changeset
|
225 else if (jb == js->user_jb) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
226 jb->subscription = JABBER_SUB_BOTH; |
28778
7c543cbf52c0
jabber: Fix removing a self-contact.
Paul Aurich <paul@darkrain42.org>
parents:
28767
diff
changeset
|
227 else if (g_str_equal(subscription, "none")) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
228 jb->subscription = JABBER_SUB_NONE; |
28778
7c543cbf52c0
jabber: Fix removing a self-contact.
Paul Aurich <paul@darkrain42.org>
parents:
28767
diff
changeset
|
229 else if (g_str_equal(subscription, "to")) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
230 jb->subscription = JABBER_SUB_TO; |
28778
7c543cbf52c0
jabber: Fix removing a self-contact.
Paul Aurich <paul@darkrain42.org>
parents:
28767
diff
changeset
|
231 else if (g_str_equal(subscription, "from")) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
232 jb->subscription = JABBER_SUB_FROM; |
28778
7c543cbf52c0
jabber: Fix removing a self-contact.
Paul Aurich <paul@darkrain42.org>
parents:
28767
diff
changeset
|
233 else if (g_str_equal(subscription, "both")) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
234 jb->subscription = JABBER_SUB_BOTH; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
235 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
236 |
27493
65b5bc543214
Remove this; it's been commented out for about 3.5 years.
Paul Aurich <paul@darkrain42.org>
parents:
27492
diff
changeset
|
237 if(purple_strequal(ask, "subscribe")) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
238 jb->subscription |= JABBER_SUB_PENDING; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
239 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
240 jb->subscription &= ~JABBER_SUB_PENDING; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
241 |
28326
5c61429ea529
jabber: Fix removing a buddy with a pending subscription.
Paul Aurich <paul@darkrain42.org>
parents:
28293
diff
changeset
|
242 if(jb->subscription & JABBER_SUB_REMOVE) { |
15822 | 243 remove_purple_buddies(js, jid); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
244 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
245 GSList *groups = NULL; |
27494
93a41017dca9
Various roster cleanups. Refs #7008.
Paul Aurich <paul@darkrain42.org>
parents:
27493
diff
changeset
|
246 gboolean seen_empty = FALSE; |
20329
24ce4fcce5b0
applied changes from e56db1b8a7bb8729e30fb3bf99a94ff7887fe4ec
Luke Schierer <lschiere@pidgin.im>
parents:
19681
diff
changeset
|
247 |
24ce4fcce5b0
applied changes from e56db1b8a7bb8729e30fb3bf99a94ff7887fe4ec
Luke Schierer <lschiere@pidgin.im>
parents:
19681
diff
changeset
|
248 if (js->server_caps & JABBER_CAP_GOOGLE_ROSTER) |
24ce4fcce5b0
applied changes from e56db1b8a7bb8729e30fb3bf99a94ff7887fe4ec
Luke Schierer <lschiere@pidgin.im>
parents:
19681
diff
changeset
|
249 if (!jabber_google_roster_incoming(js, item)) |
24ce4fcce5b0
applied changes from e56db1b8a7bb8729e30fb3bf99a94ff7887fe4ec
Luke Schierer <lschiere@pidgin.im>
parents:
19681
diff
changeset
|
250 continue; |
24ce4fcce5b0
applied changes from e56db1b8a7bb8729e30fb3bf99a94ff7887fe4ec
Luke Schierer <lschiere@pidgin.im>
parents:
19681
diff
changeset
|
251 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
252 for(group = xmlnode_get_child(item, "group"); group; group = xmlnode_get_next_twin(group)) { |
27494
93a41017dca9
Various roster cleanups. Refs #7008.
Paul Aurich <paul@darkrain42.org>
parents:
27493
diff
changeset
|
253 char *group_name = xmlnode_get_data(group); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
254 |
27494
93a41017dca9
Various roster cleanups. Refs #7008.
Paul Aurich <paul@darkrain42.org>
parents:
27493
diff
changeset
|
255 if (!group_name && !seen_empty) { |
93a41017dca9
Various roster cleanups. Refs #7008.
Paul Aurich <paul@darkrain42.org>
parents:
27493
diff
changeset
|
256 group_name = g_strdup(""); |
93a41017dca9
Various roster cleanups. Refs #7008.
Paul Aurich <paul@darkrain42.org>
parents:
27493
diff
changeset
|
257 seen_empty = TRUE; |
93a41017dca9
Various roster cleanups. Refs #7008.
Paul Aurich <paul@darkrain42.org>
parents:
27493
diff
changeset
|
258 } |
93a41017dca9
Various roster cleanups. Refs #7008.
Paul Aurich <paul@darkrain42.org>
parents:
27493
diff
changeset
|
259 |
29050
d4b9df8e17f6
jabber: Fix another corner case that introduced duplicates to the list.
Paul Aurich <paul@darkrain42.org>
parents:
29035
diff
changeset
|
260 /* |
d4b9df8e17f6
jabber: Fix another corner case that introduced duplicates to the list.
Paul Aurich <paul@darkrain42.org>
parents:
29035
diff
changeset
|
261 * See the note in add_purple_buddy_to_groups; the core handles |
d4b9df8e17f6
jabber: Fix another corner case that introduced duplicates to the list.
Paul Aurich <paul@darkrain42.org>
parents:
29035
diff
changeset
|
262 * names case-insensitively and this is required to not |
d4b9df8e17f6
jabber: Fix another corner case that introduced duplicates to the list.
Paul Aurich <paul@darkrain42.org>
parents:
29035
diff
changeset
|
263 * end up with duplicates if a buddy is in, e.g., |
d4b9df8e17f6
jabber: Fix another corner case that introduced duplicates to the list.
Paul Aurich <paul@darkrain42.org>
parents:
29035
diff
changeset
|
264 * 'XMPP' and 'xmpp' |
d4b9df8e17f6
jabber: Fix another corner case that introduced duplicates to the list.
Paul Aurich <paul@darkrain42.org>
parents:
29035
diff
changeset
|
265 */ |
d4b9df8e17f6
jabber: Fix another corner case that introduced duplicates to the list.
Paul Aurich <paul@darkrain42.org>
parents:
29035
diff
changeset
|
266 if (g_slist_find_custom(groups, group_name, (GCompareFunc)purple_utf8_strcasecmp)) |
d4b9df8e17f6
jabber: Fix another corner case that introduced duplicates to the list.
Paul Aurich <paul@darkrain42.org>
parents:
29035
diff
changeset
|
267 g_free(group_name); |
d4b9df8e17f6
jabber: Fix another corner case that introduced duplicates to the list.
Paul Aurich <paul@darkrain42.org>
parents:
29035
diff
changeset
|
268 else |
d4b9df8e17f6
jabber: Fix another corner case that introduced duplicates to the list.
Paul Aurich <paul@darkrain42.org>
parents:
29035
diff
changeset
|
269 groups = g_slist_prepend(groups, group_name); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
270 } |
27494
93a41017dca9
Various roster cleanups. Refs #7008.
Paul Aurich <paul@darkrain42.org>
parents:
27493
diff
changeset
|
271 |
27794
eb2d17945ce3
jabber: Store the "own JabberBuddy" in the JabberStream* struct.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
272 add_purple_buddy_to_groups(js, jid, name, groups); |
eb2d17945ce3
jabber: Store the "own JabberBuddy" in the JabberStream* struct.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
273 if (jb == js->user_jb) |
eb2d17945ce3
jabber: Store the "own JabberBuddy" in the JabberStream* struct.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
274 jabber_presence_fake_to_self(js, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
275 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
276 } |
18124
f88c2a41200d
fix inital presence (fixes #1395)
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
277 |
28848
2f64bfb21c0d
Disable this part of roster versioning, too (for now). Refs #10935.
Paul Aurich <paul@darkrain42.org>
parents:
28780
diff
changeset
|
278 #if 0 |
28760
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
279 ver = xmlnode_get_attrib(query, "ver"); |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
280 if (ver) { |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
281 PurpleAccount *account = purple_connection_get_account(js->gc); |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
282 purple_account_set_string(account, "roster_ver", ver); |
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
283 } |
28848
2f64bfb21c0d
Disable this part of roster versioning, too (for now). Refs #10935.
Paul Aurich <paul@darkrain42.org>
parents:
28780
diff
changeset
|
284 #endif |
23646
c31dfae66134
Hopefully fix the XMPP contact flipping/swapping between groups bug
Mark Doliner <mark@kingant.net>
parents:
23423
diff
changeset
|
285 |
29035
f7f14706618b
jabber: Send the RFC-mandated ack IQ
Paul Aurich <paul@darkrain42.org>
parents:
28848
diff
changeset
|
286 if (type == JABBER_IQ_SET) { |
f7f14706618b
jabber: Send the RFC-mandated ack IQ
Paul Aurich <paul@darkrain42.org>
parents:
28848
diff
changeset
|
287 JabberIq *ack = jabber_iq_new(js, JABBER_IQ_RESULT); |
f7f14706618b
jabber: Send the RFC-mandated ack IQ
Paul Aurich <paul@darkrain42.org>
parents:
28848
diff
changeset
|
288 jabber_iq_set_id(ack, id); |
f7f14706618b
jabber: Send the RFC-mandated ack IQ
Paul Aurich <paul@darkrain42.org>
parents:
28848
diff
changeset
|
289 jabber_iq_send(ack); |
f7f14706618b
jabber: Send the RFC-mandated ack IQ
Paul Aurich <paul@darkrain42.org>
parents:
28848
diff
changeset
|
290 } |
f7f14706618b
jabber: Send the RFC-mandated ack IQ
Paul Aurich <paul@darkrain42.org>
parents:
28848
diff
changeset
|
291 |
28760
0f7025534fc5
jabber: Roster Versioning support.
Paul Aurich <paul@darkrain42.org>
parents:
28436
diff
changeset
|
292 js->currently_parsing_roster_push = FALSE; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
293 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
294 |
27500
b9da56683499
Operate on the passed-in GSList.
Paul Aurich <paul@darkrain42.org>
parents:
27499
diff
changeset
|
295 /* jabber_roster_update frees the GSList* passed in */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
296 static void jabber_roster_update(JabberStream *js, const char *name, |
27500
b9da56683499
Operate on the passed-in GSList.
Paul Aurich <paul@darkrain42.org>
parents:
27499
diff
changeset
|
297 GSList *groups) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
298 { |
15822 | 299 PurpleBuddy *b; |
300 PurpleGroup *g; | |
27500
b9da56683499
Operate on the passed-in GSList.
Paul Aurich <paul@darkrain42.org>
parents:
27499
diff
changeset
|
301 GSList *l; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
302 JabberIq *iq; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
303 xmlnode *query, *item, *group; |
25803
8aa7d8bcbc7d
Alias foo. I think blist.h structs are now completely hidden.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25130
diff
changeset
|
304 const char *balias; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
305 |
23648
9bf36aad8735
We talked about this and decided it was probably cleaner to not use
Mark Doliner <mark@kingant.net>
parents:
23646
diff
changeset
|
306 if (js->currently_parsing_roster_push) |
23646
c31dfae66134
Hopefully fix the XMPP contact flipping/swapping between groups bug
Mark Doliner <mark@kingant.net>
parents:
23423
diff
changeset
|
307 return; |
c31dfae66134
Hopefully fix the XMPP contact flipping/swapping between groups bug
Mark Doliner <mark@kingant.net>
parents:
23423
diff
changeset
|
308 |
20329
24ce4fcce5b0
applied changes from e56db1b8a7bb8729e30fb3bf99a94ff7887fe4ec
Luke Schierer <lschiere@pidgin.im>
parents:
19681
diff
changeset
|
309 if(!(b = purple_find_buddy(js->gc->account, name))) |
24ce4fcce5b0
applied changes from e56db1b8a7bb8729e30fb3bf99a94ff7887fe4ec
Luke Schierer <lschiere@pidgin.im>
parents:
19681
diff
changeset
|
310 return; |
24ce4fcce5b0
applied changes from e56db1b8a7bb8729e30fb3bf99a94ff7887fe4ec
Luke Schierer <lschiere@pidgin.im>
parents:
19681
diff
changeset
|
311 |
27500
b9da56683499
Operate on the passed-in GSList.
Paul Aurich <paul@darkrain42.org>
parents:
27499
diff
changeset
|
312 if (groups) { |
27499
efb40ca43589
Debug output when changing group memberships.
Paul Aurich <paul@darkrain42.org>
parents:
27498
diff
changeset
|
313 char *tmp = roster_groups_join(groups); |
27011
f2ca52166a0d
Add a few more roster debug messages and improve.
Paul Aurich <paul@darkrain42.org>
parents:
27010
diff
changeset
|
314 |
27500
b9da56683499
Operate on the passed-in GSList.
Paul Aurich <paul@darkrain42.org>
parents:
27499
diff
changeset
|
315 purple_debug_info("jabber", "jabber_roster_update(%s): [Source: " |
b9da56683499
Operate on the passed-in GSList.
Paul Aurich <paul@darkrain42.org>
parents:
27499
diff
changeset
|
316 "groups]: groups: %s\n", name, tmp); |
27499
efb40ca43589
Debug output when changing group memberships.
Paul Aurich <paul@darkrain42.org>
parents:
27498
diff
changeset
|
317 g_free(tmp); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
318 } else { |
15822 | 319 GSList *buddies = purple_find_buddies(js->gc->account, name); |
27499
efb40ca43589
Debug output when changing group memberships.
Paul Aurich <paul@darkrain42.org>
parents:
27498
diff
changeset
|
320 char *tmp; |
27011
f2ca52166a0d
Add a few more roster debug messages and improve.
Paul Aurich <paul@darkrain42.org>
parents:
27010
diff
changeset
|
321 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
322 if(!buddies) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
323 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
324 while(buddies) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
325 b = buddies->data; |
15822 | 326 g = purple_buddy_get_group(b); |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24002
diff
changeset
|
327 groups = g_slist_append(groups, (char *)purple_group_get_name(g)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
328 buddies = g_slist_remove(buddies, b); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
329 } |
27011
f2ca52166a0d
Add a few more roster debug messages and improve.
Paul Aurich <paul@darkrain42.org>
parents:
27010
diff
changeset
|
330 |
27499
efb40ca43589
Debug output when changing group memberships.
Paul Aurich <paul@darkrain42.org>
parents:
27498
diff
changeset
|
331 tmp = roster_groups_join(groups); |
27011
f2ca52166a0d
Add a few more roster debug messages and improve.
Paul Aurich <paul@darkrain42.org>
parents:
27010
diff
changeset
|
332 purple_debug_info("jabber", "jabber_roster_update(%s): [Source: local blist]: groups: %s\n", |
27499
efb40ca43589
Debug output when changing group memberships.
Paul Aurich <paul@darkrain42.org>
parents:
27498
diff
changeset
|
333 name, tmp); |
efb40ca43589
Debug output when changing group memberships.
Paul Aurich <paul@darkrain42.org>
parents:
27498
diff
changeset
|
334 g_free(tmp); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
335 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
336 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
337 iq = jabber_iq_new_query(js, JABBER_IQ_SET, "jabber:iq:roster"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
338 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
339 query = xmlnode_get_child(iq->node, "query"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
340 item = xmlnode_new_child(query, "item"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
341 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
342 xmlnode_set_attrib(item, "jid", name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
343 |
25803
8aa7d8bcbc7d
Alias foo. I think blist.h structs are now completely hidden.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25130
diff
changeset
|
344 balias = purple_buddy_get_local_buddy_alias(b); |
8aa7d8bcbc7d
Alias foo. I think blist.h structs are now completely hidden.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25130
diff
changeset
|
345 xmlnode_set_attrib(item, "name", balias ? balias : ""); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
346 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
347 for(l = groups; l; l = l->next) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
348 group = xmlnode_new_child(item, "group"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
349 xmlnode_insert_data(group, l->data, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
350 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
351 |
27500
b9da56683499
Operate on the passed-in GSList.
Paul Aurich <paul@darkrain42.org>
parents:
27499
diff
changeset
|
352 g_slist_free(groups); |
25952
5f9a24d1c25e
Remove some extra trailing whitespace I noticed after merging mlundblad's
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25836
diff
changeset
|
353 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
354 if (js->server_caps & JABBER_CAP_GOOGLE_ROSTER) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
355 jabber_google_roster_outgoing(js, query, item); |
28767
9ab75ab032b4
jabber: The google roster request code was so lonely, so let's just drop-kick it and add the little custom logic to roster.c
Paul Aurich <paul@darkrain42.org>
parents:
28760
diff
changeset
|
356 xmlnode_set_attrib(query, "xmlns:gr", NS_GOOGLE_ROSTER); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
357 xmlnode_set_attrib(query, "gr:ext", "2"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
358 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
359 jabber_iq_send(iq); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
360 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
361 |
15822 | 362 void jabber_roster_add_buddy(PurpleConnection *gc, PurpleBuddy *buddy, |
363 PurpleGroup *group) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
364 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
365 JabberStream *js = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
366 char *who; |
28150
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
367 JabberID *jid; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
368 JabberBuddy *jb; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
369 JabberBuddyResource *jbr; |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24002
diff
changeset
|
370 const char *name; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
371 |
27495
c8390dc125c1
Use js->state to track whether the roster has been retrieved.
Paul Aurich <paul@darkrain42.org>
parents:
27494
diff
changeset
|
372 /* If we haven't received the roster yet, ignore any adds */ |
c8390dc125c1
Use js->state to track whether the roster has been retrieved.
Paul Aurich <paul@darkrain42.org>
parents:
27494
diff
changeset
|
373 if (js->state != JABBER_STREAM_CONNECTED) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
374 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
375 |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24002
diff
changeset
|
376 name = purple_buddy_get_name(buddy); |
28150
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
377 jid = jabber_id_new(name); |
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
378 if (jid == NULL) { |
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
379 /* TODO: Remove the buddy from the list? */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
380 return; |
28150
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
381 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
382 |
28150
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
383 /* Adding a chat room or a chat buddy to the roster is *not* supported. */ |
28293
c42d5c23a9e8
jabber: Don't crash when adding a buddy without a node (no '@'). Closes #10261.
Paul Aurich <paul@darkrain42.org>
parents:
28150
diff
changeset
|
384 if (jid->node && jabber_chat_find(js, jid->node, jid->domain) != NULL) { |
28150
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
385 /* |
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
386 * This is the same thing Bonjour does. If it causes problems, move |
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
387 * it to an idle callback. |
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
388 */ |
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
389 purple_debug_warning("jabber", "Cowardly refusing to add a MUC user " |
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
390 "to your buddy list and removing the buddy. " |
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
391 "Buddies can only be added by real (non-MUC) " |
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
392 "JID\n"); |
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
393 purple_blist_remove_buddy(buddy); |
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
394 jabber_id_free(jid); |
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
395 return; |
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
396 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
397 |
28150
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
398 who = jabber_id_get_bare_jid(jid); |
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
399 if (jid->resource != NULL) { |
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
400 /* |
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
401 * If the buddy name added contains a resource, strip that off and |
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
402 * rename the buddy. |
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
403 */ |
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
404 purple_blist_rename_buddy(buddy, who); |
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
405 } |
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
406 |
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
407 jb = jabber_buddy_find(js, who, FALSE); |
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
408 |
2e3678cd33a0
jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <paul@darkrain42.org>
parents:
28048
diff
changeset
|
409 purple_debug_info("jabber", "jabber_roster_add_buddy(): Adding %s\n", who); |
27011
f2ca52166a0d
Add a few more roster debug messages and improve.
Paul Aurich <paul@darkrain42.org>
parents:
27010
diff
changeset
|
410 |
23423
a2f63b74fe31
Alright, I'm getting rid of this "groups" thing for the reason listed
Mark Doliner <mark@kingant.net>
parents:
22845
diff
changeset
|
411 jabber_roster_update(js, who, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
412 |
27794
eb2d17945ce3
jabber: Store the "own JabberBuddy" in the JabberStream* struct.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
413 if (jb == js->user_jb) { |
27497
9a5a9a4e7626
Simplify the fake_to_self function.
Paul Aurich <paul@darkrain42.org>
parents:
27495
diff
changeset
|
414 jabber_presence_fake_to_self(js, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
415 } else if(!jb || !(jb->subscription & JABBER_SUB_TO)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
416 jabber_presence_subscription_set(js, who, "subscribe"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
417 } else if((jbr =jabber_buddy_find_resource(jb, NULL))) { |
15822 | 418 purple_prpl_got_user_status(gc->account, who, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
419 jabber_buddy_state_get_status_id(jbr->state), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
420 "priority", jbr->priority, jbr->status ? "message" : NULL, jbr->status, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
421 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
422 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
423 g_free(who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
424 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
425 |
15822 | 426 void jabber_roster_alias_change(PurpleConnection *gc, const char *name, const char *alias) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
427 { |
15822 | 428 PurpleBuddy *b = purple_find_buddy(gc->account, name); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
429 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
430 if(b != NULL) { |
15822 | 431 purple_blist_alias_buddy(b, alias); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
432 |
27011
f2ca52166a0d
Add a few more roster debug messages and improve.
Paul Aurich <paul@darkrain42.org>
parents:
27010
diff
changeset
|
433 purple_debug_info("jabber", "jabber_roster_alias_change(): Aliased %s to %s\n", |
27023
7c864f388c96
Ladedah I dislike the need to explicitly check for NULL strings.
Paul Aurich <paul@darkrain42.org>
parents:
27011
diff
changeset
|
434 name, alias ? alias : "(null)"); |
27010
a500f65bd077
Pluck Adium's roster debugging from 86720de21a854aa
Paul Aurich <paul@darkrain42.org>
parents:
26487
diff
changeset
|
435 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
436 jabber_roster_update(gc->proto_data, name, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
437 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
438 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
439 |
15822 | 440 void jabber_roster_group_change(PurpleConnection *gc, const char *name, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
441 const char *old_group, const char *new_group) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
442 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
443 GSList *buddies, *groups = NULL; |
15822 | 444 PurpleBuddy *b; |
445 PurpleGroup *g; | |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24002
diff
changeset
|
446 const char *gname; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
447 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
448 if(!old_group || !new_group || !strcmp(old_group, new_group)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
449 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
450 |
15822 | 451 buddies = purple_find_buddies(gc->account, name); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
452 while(buddies) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
453 b = buddies->data; |
15822 | 454 g = purple_buddy_get_group(b); |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24002
diff
changeset
|
455 gname = purple_group_get_name(g); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24002
diff
changeset
|
456 if(!strcmp(gname, old_group)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
457 groups = g_slist_append(groups, (char*)new_group); /* ick */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
458 else |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24002
diff
changeset
|
459 groups = g_slist_append(groups, (char*)gname); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
460 buddies = g_slist_remove(buddies, b); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
461 } |
27010
a500f65bd077
Pluck Adium's roster debugging from 86720de21a854aa
Paul Aurich <paul@darkrain42.org>
parents:
26487
diff
changeset
|
462 |
27011
f2ca52166a0d
Add a few more roster debug messages and improve.
Paul Aurich <paul@darkrain42.org>
parents:
27010
diff
changeset
|
463 purple_debug_info("jabber", "jabber_roster_group_change(): Moving %s from %s to %s\n", |
f2ca52166a0d
Add a few more roster debug messages and improve.
Paul Aurich <paul@darkrain42.org>
parents:
27010
diff
changeset
|
464 name, old_group, new_group); |
27010
a500f65bd077
Pluck Adium's roster debugging from 86720de21a854aa
Paul Aurich <paul@darkrain42.org>
parents:
26487
diff
changeset
|
465 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
466 jabber_roster_update(gc->proto_data, name, groups); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
467 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
468 |
15822 | 469 void jabber_roster_group_rename(PurpleConnection *gc, const char *old_name, |
470 PurpleGroup *group, GList *moved_buddies) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
471 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
472 GList *l; |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24002
diff
changeset
|
473 const char *gname = purple_group_get_name(group); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
474 for(l = moved_buddies; l; l = l->next) { |
15822 | 475 PurpleBuddy *buddy = l->data; |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24002
diff
changeset
|
476 jabber_roster_group_change(gc, purple_buddy_get_name(buddy), old_name, gname); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
477 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
478 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
479 |
15822 | 480 void jabber_roster_remove_buddy(PurpleConnection *gc, PurpleBuddy *buddy, |
481 PurpleGroup *group) { | |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24002
diff
changeset
|
482 const char *name = purple_buddy_get_name(buddy); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24002
diff
changeset
|
483 GSList *buddies = purple_find_buddies(purple_connection_get_account(gc), name); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
484 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
485 buddies = g_slist_remove(buddies, buddy); |
15785
e926951e61fe
Don't use g_list_length() and g_slist_length() when all you want to
Mark Doliner <mark@kingant.net>
parents:
15633
diff
changeset
|
486 if(buddies != NULL) { |
15822 | 487 PurpleBuddy *tmpbuddy; |
488 PurpleGroup *tmpgroup; | |
20333
53afc5cce143
applied changes from d4b316d73ebaf93803ca2642e78b8821c3b5d5c7
Luke Schierer <lschiere@pidgin.im>
parents:
20329
diff
changeset
|
489 GSList *groups = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
490 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
491 while(buddies) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
492 tmpbuddy = buddies->data; |
15822 | 493 tmpgroup = purple_buddy_get_group(tmpbuddy); |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24002
diff
changeset
|
494 groups = g_slist_append(groups, (char *)purple_group_get_name(tmpgroup)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
495 buddies = g_slist_remove(buddies, tmpbuddy); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
496 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
497 |
27011
f2ca52166a0d
Add a few more roster debug messages and improve.
Paul Aurich <paul@darkrain42.org>
parents:
27010
diff
changeset
|
498 purple_debug_info("jabber", "jabber_roster_remove_buddy(): Removing %s from %s\n", |
f2ca52166a0d
Add a few more roster debug messages and improve.
Paul Aurich <paul@darkrain42.org>
parents:
27010
diff
changeset
|
499 purple_buddy_get_name(buddy), purple_group_get_name(group)); |
27010
a500f65bd077
Pluck Adium's roster debugging from 86720de21a854aa
Paul Aurich <paul@darkrain42.org>
parents:
26487
diff
changeset
|
500 |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24002
diff
changeset
|
501 jabber_roster_update(gc->proto_data, name, groups); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
502 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
503 JabberIq *iq = jabber_iq_new_query(gc->proto_data, JABBER_IQ_SET, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
504 "jabber:iq:roster"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
505 xmlnode *query = xmlnode_get_child(iq->node, "query"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
506 xmlnode *item = xmlnode_new_child(query, "item"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
507 |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24002
diff
changeset
|
508 xmlnode_set_attrib(item, "jid", name); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
509 xmlnode_set_attrib(item, "subscription", "remove"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
510 |
27011
f2ca52166a0d
Add a few more roster debug messages and improve.
Paul Aurich <paul@darkrain42.org>
parents:
27010
diff
changeset
|
511 purple_debug_info("jabber", "jabber_roster_remove_buddy(): Removing %s\n", |
f2ca52166a0d
Add a few more roster debug messages and improve.
Paul Aurich <paul@darkrain42.org>
parents:
27010
diff
changeset
|
512 purple_buddy_get_name(buddy)); |
f2ca52166a0d
Add a few more roster debug messages and improve.
Paul Aurich <paul@darkrain42.org>
parents:
27010
diff
changeset
|
513 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
514 jabber_iq_send(iq); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
515 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
516 } |