Tue, 28 Aug 2007 04:38:24 +0000
propagate from branch 'im.pidgin.pidgin' (head 3848f6f679fdf3688c76ac9653e901c4e5314e2f)
to branch 'im.pidgin.cpw.khc.msnp14' (head 35675dd4a44dd411167ad0cbcdcd48ec7cdf962f)
|
9198
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9197
diff
changeset
|
1 | /** |
|
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9197
diff
changeset
|
2 | * @file userlist.c MSN user list support |
|
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9197
diff
changeset
|
3 | * |
| 15884 | 4 | * purple |
|
9198
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9197
diff
changeset
|
5 | * |
| 15884 | 6 | * Purple is the legal property of its developers, whose names are too numerous |
|
9198
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9197
diff
changeset
|
7 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9197
diff
changeset
|
8 | * source distribution. |
|
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9197
diff
changeset
|
9 | * |
|
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9197
diff
changeset
|
10 | * This program is free software; you can redistribute it and/or modify |
|
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9197
diff
changeset
|
11 | * it under the terms of the GNU General Public License as published by |
|
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9197
diff
changeset
|
12 | * the Free Software Foundation; either version 2 of the License, or |
|
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9197
diff
changeset
|
13 | * (at your option) any later version. |
|
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9197
diff
changeset
|
14 | * |
|
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9197
diff
changeset
|
15 | * This program is distributed in the hope that it will be useful, |
|
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9197
diff
changeset
|
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9197
diff
changeset
|
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9197
diff
changeset
|
18 | * GNU General Public License for more details. |
|
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9197
diff
changeset
|
19 | * |
|
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9197
diff
changeset
|
20 | * You should have received a copy of the GNU General Public License |
|
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9197
diff
changeset
|
21 | * along with this program; if not, write to the Free Software |
|
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9197
diff
changeset
|
22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9197
diff
changeset
|
23 | */ |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
24 | #include "msn.h" |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
25 | #include "userlist.h" |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
26 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
27 | const char *lists[] = { "FL", "AL", "BL", "RL" }; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
28 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
29 | typedef struct |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
30 | { |
| 15884 | 31 | PurpleConnection *gc; |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
32 | char *who; |
|
12380
0b1e1b2ad52a
[gaim-migrate @ 14684]
Daniel Atallah <datallah@pidgin.im>
parents:
12318
diff
changeset
|
33 | char *friendly; |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
34 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
35 | } MsnPermitAdd; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
36 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
37 | /************************************************************************** |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
38 | * Callbacks |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
39 | **************************************************************************/ |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
40 | static void |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
41 | msn_accept_add_cb(MsnPermitAdd *pa) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
42 | { |
|
14030
23144f1dc950
[gaim-migrate @ 16525]
Mark Doliner <markdoliner@pidgin.im>
parents:
13829
diff
changeset
|
43 | MsnSession *session = pa->gc->proto_data; |
|
23144f1dc950
[gaim-migrate @ 16525]
Mark Doliner <markdoliner@pidgin.im>
parents:
13829
diff
changeset
|
44 | MsnUserList *userlist = session->userlist; |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
45 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
46 | msn_userlist_add_buddy_to_list(userlist, pa->who, MSN_LIST_AL); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
47 | msn_userlist_add_buddy(userlist, pa->who, NULL); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
48 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
49 | g_free(pa->who); |
|
12380
0b1e1b2ad52a
[gaim-migrate @ 14684]
Daniel Atallah <datallah@pidgin.im>
parents:
12318
diff
changeset
|
50 | g_free(pa->friendly); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
51 | g_free(pa); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
52 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
53 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
54 | static void |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
55 | msn_cancel_add_cb(MsnPermitAdd *pa) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
56 | { |
|
20478
46933dc62880
propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
diff
changeset
|
57 | if (g_list_find(purple_connections_get_all(), pa->gc) != NULL) |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
58 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
59 | MsnSession *session = pa->gc->proto_data; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
60 | MsnUserList *userlist = session->userlist; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
61 | |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
62 | msn_userlist_add_buddy_to_list(userlist, pa->who, MSN_LIST_BL); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
63 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
64 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
65 | g_free(pa->who); |
|
12380
0b1e1b2ad52a
[gaim-migrate @ 14684]
Daniel Atallah <datallah@pidgin.im>
parents:
12318
diff
changeset
|
66 | g_free(pa->friendly); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
67 | g_free(pa); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
68 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
69 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
70 | static void |
| 15884 | 71 | got_new_entry(PurpleConnection *gc, const char *passport, const char *friendly) |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
72 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
73 | MsnPermitAdd *pa; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
74 | |
|
12380
0b1e1b2ad52a
[gaim-migrate @ 14684]
Daniel Atallah <datallah@pidgin.im>
parents:
12318
diff
changeset
|
75 | pa = g_new0(MsnPermitAdd, 1); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
76 | pa->who = g_strdup(passport); |
|
12381
9a27a50d3864
[gaim-migrate @ 14685]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12380
diff
changeset
|
77 | pa->friendly = g_strdup(friendly); |
|
12380
0b1e1b2ad52a
[gaim-migrate @ 14684]
Daniel Atallah <datallah@pidgin.im>
parents:
12318
diff
changeset
|
78 | pa->gc = gc; |
| 15119 | 79 | |
| 15884 | 80 | purple_account_request_authorization(purple_connection_get_account(gc), passport, NULL, friendly, NULL, |
| 81 | purple_find_buddy(purple_connection_get_account(gc), passport) != NULL, | |
|
15142
32b4b0750b6c
[gaim-migrate @ 17866]
Mark Doliner <markdoliner@pidgin.im>
parents:
15119
diff
changeset
|
82 | G_CALLBACK(msn_accept_add_cb), G_CALLBACK(msn_cancel_add_cb), pa); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
83 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
84 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
85 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
86 | /************************************************************************** |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
87 | * Utility functions |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
88 | **************************************************************************/ |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
89 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
90 | static gboolean |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
91 | msn_userlist_user_is_in_group(MsnUser *user, const char * group_id) |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
92 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
93 | if (user == NULL) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
94 | return FALSE; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
95 | |
| 13855 | 96 | if (group_id == NULL) |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
97 | return FALSE; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
98 | |
|
20531
49f6663daa4a
Update a couple of instances of group_id handling to cope with the new
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20522
diff
changeset
|
99 | if (g_list_find_custom(user->group_ids, group_id, (GCompareFunc)strcmp)) |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
100 | return TRUE; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
101 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
102 | return FALSE; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
103 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
104 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
105 | static gboolean |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
106 | msn_userlist_user_is_in_list(MsnUser *user, int list_id) |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
107 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
108 | int list_op; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
109 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
110 | if (user == NULL) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
111 | return FALSE; |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
112 | |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
113 | list_op = 1 << list_id; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
114 | |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
115 | if (user->list_op & list_op) |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
116 | return TRUE; |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
117 | else |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
118 | return FALSE; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
119 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
120 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
121 | static const char* |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
122 | get_store_name(MsnUser *user) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
123 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
124 | const char *store_name; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
125 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
126 | g_return_val_if_fail(user != NULL, NULL); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
127 | |
|
10533
4c2ad22fad20
[gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10504
diff
changeset
|
128 | store_name = msn_user_get_store_name(user); |
|
4c2ad22fad20
[gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10504
diff
changeset
|
129 | |
|
4c2ad22fad20
[gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10504
diff
changeset
|
130 | if (store_name != NULL) |
| 15884 | 131 | store_name = purple_url_encode(store_name); |
|
10533
4c2ad22fad20
[gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10504
diff
changeset
|
132 | else |
|
4c2ad22fad20
[gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10504
diff
changeset
|
133 | store_name = msn_user_get_passport(user); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
134 | |
|
10533
4c2ad22fad20
[gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10504
diff
changeset
|
135 | /* this might be a bit of a hack, but it should prevent notification server |
|
4c2ad22fad20
[gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10504
diff
changeset
|
136 | * disconnections for people who have buddies with insane friendly names |
|
4c2ad22fad20
[gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10504
diff
changeset
|
137 | * who added you to their buddy list from being disconnected. Stu. */ |
|
4c2ad22fad20
[gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10504
diff
changeset
|
138 | /* Shx: What? Isn't the store_name obtained from the server, and hence it's |
|
4c2ad22fad20
[gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10504
diff
changeset
|
139 | * below the BUDDY_ALIAS_MAXLEN ? */ |
|
4c2ad22fad20
[gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10504
diff
changeset
|
140 | /* Stu: yeah, that's why it's a bit of a hack, as you pointed out, we're |
|
4c2ad22fad20
[gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10504
diff
changeset
|
141 | * probably decoding the incoming store_name wrong, or something. bleh. */ |
|
4c2ad22fad20
[gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10504
diff
changeset
|
142 | |
|
4c2ad22fad20
[gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10504
diff
changeset
|
143 | if (strlen(store_name) > BUDDY_ALIAS_MAXLEN) |
|
4c2ad22fad20
[gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10504
diff
changeset
|
144 | store_name = msn_user_get_passport(user); |
|
4c2ad22fad20
[gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10504
diff
changeset
|
145 | |
|
4c2ad22fad20
[gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10504
diff
changeset
|
146 | return store_name; |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
147 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
148 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
149 | /************************************************************************** |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
150 | * Server functions |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
151 | **************************************************************************/ |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
152 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
153 | MsnListId |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
154 | msn_get_list_id(const char *list) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
155 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
156 | if (list[0] == 'F') |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
157 | return MSN_LIST_FL; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
158 | else if (list[0] == 'A') |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
159 | return MSN_LIST_AL; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
160 | else if (list[0] == 'B') |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
161 | return MSN_LIST_BL; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
162 | else if (list[0] == 'R') |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
163 | return MSN_LIST_RL; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
164 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
165 | return -1; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
166 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
167 | |
|
20546
35d778ab0450
Correctly process an additional <Service> with type Profile and name 'Messenger Roaming Identity' sent with the contact list using a recently registered WLM account, that was causing the initial ADL command to be sent malformed, and our presence status not being forwarded to our buddies
Carlos Silva <typ0@pidgin.im>
parents:
20531
diff
changeset
|
168 | /* this function msn_got_add_user isn't called anywhere */ |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
169 | void |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
170 | msn_got_add_user(MsnSession *session, MsnUser *user, |
| 13855 | 171 | MsnListId list_id, const char * group_id) |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
172 | { |
| 15884 | 173 | PurpleAccount *account; |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
174 | const char *passport; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
175 | const char *friendly; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
176 | |
|
20550
af5abde0d99f
Misc cleanups, better error handling, and print the Address Book received from the server in a human readable way.
Carlos Silva <typ0@pidgin.im>
parents:
20546
diff
changeset
|
177 | purple_debug_info("MSNP14","got add user...\n"); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
178 | account = session->account; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
179 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
180 | passport = msn_user_get_passport(user); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
181 | friendly = msn_user_get_friendly_name(user); |
|
9197
3c9b907b45a7
[gaim-migrate @ 9992]
Christian Hammond <chipx86@chipx86.com>
parents:
9196
diff
changeset
|
182 | |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
183 | if (list_id == MSN_LIST_FL) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
184 | { |
| 15884 | 185 | PurpleConnection *gc; |
|
9861
2aae2032f2bf
[gaim-migrate @ 10740]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9860
diff
changeset
|
186 | |
| 15884 | 187 | gc = purple_account_get_connection(account); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
188 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
189 | serv_got_alias(gc, passport, friendly); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
190 | |
| 13855 | 191 | if (group_id != NULL) |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
192 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
193 | msn_user_add_group_id(user, group_id); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
194 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
195 | else |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
196 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
197 | /* session->sync->fl_users_count++; */ |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
198 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
199 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
200 | else if (list_id == MSN_LIST_AL) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
201 | { |
| 15884 | 202 | purple_privacy_permit_add(account, passport, TRUE); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
203 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
204 | else if (list_id == MSN_LIST_BL) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
205 | { |
| 15884 | 206 | purple_privacy_deny_add(account, passport, TRUE); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
207 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
208 | else if (list_id == MSN_LIST_RL) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
209 | { |
| 15884 | 210 | PurpleConnection *gc; |
| 211 | PurpleConversation *convo; | |
|
9861
2aae2032f2bf
[gaim-migrate @ 10740]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9860
diff
changeset
|
212 | |
| 15884 | 213 | gc = purple_account_get_connection(account); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
214 | |
| 15884 | 215 | purple_debug_info("msn", |
|
12318
942b7c089acb
[gaim-migrate @ 14622]
Richard Laager <rlaager@pidgin.im>
parents:
11638
diff
changeset
|
216 | "%s has added you to his or her buddy list.\n", |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
217 | passport); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
218 | |
| 15884 | 219 | convo = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, passport, account); |
|
11039
5ced3cea0867
[gaim-migrate @ 12938]
Richard Laager <rlaager@pidgin.im>
parents:
10774
diff
changeset
|
220 | if (convo) { |
| 15884 | 221 | PurpleBuddy *buddy; |
|
11039
5ced3cea0867
[gaim-migrate @ 12938]
Richard Laager <rlaager@pidgin.im>
parents:
10774
diff
changeset
|
222 | char *msg; |
|
5ced3cea0867
[gaim-migrate @ 12938]
Richard Laager <rlaager@pidgin.im>
parents:
10774
diff
changeset
|
223 | |
| 15884 | 224 | buddy = purple_find_buddy(account, passport); |
|
11039
5ced3cea0867
[gaim-migrate @ 12938]
Richard Laager <rlaager@pidgin.im>
parents:
10774
diff
changeset
|
225 | msg = g_strdup_printf( |
|
12318
942b7c089acb
[gaim-migrate @ 14622]
Richard Laager <rlaager@pidgin.im>
parents:
11638
diff
changeset
|
226 | _("%s has added you to his or her buddy list."), |
| 15884 | 227 | buddy ? purple_buddy_get_contact_alias(buddy) : passport); |
| 228 | purple_conv_im_write(PURPLE_CONV_IM(convo), passport, msg, | |
| 229 | PURPLE_MESSAGE_SYSTEM, time(NULL)); | |
|
11039
5ced3cea0867
[gaim-migrate @ 12938]
Richard Laager <rlaager@pidgin.im>
parents:
10774
diff
changeset
|
230 | g_free(msg); |
|
5ced3cea0867
[gaim-migrate @ 12938]
Richard Laager <rlaager@pidgin.im>
parents:
10774
diff
changeset
|
231 | } |
|
5ced3cea0867
[gaim-migrate @ 12938]
Richard Laager <rlaager@pidgin.im>
parents:
10774
diff
changeset
|
232 | |
|
10583
6e191c459a4a
[gaim-migrate @ 11985]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10568
diff
changeset
|
233 | if (!(user->list_op & (MSN_LIST_AL_OP | MSN_LIST_BL_OP))) |
|
9223
a23e96623e47
[gaim-migrate @ 10019]
Christian Hammond <chipx86@chipx86.com>
parents:
9218
diff
changeset
|
234 | { |
|
13829
ac73840b2117
[gaim-migrate @ 16271]
Mark Doliner <markdoliner@pidgin.im>
parents:
13694
diff
changeset
|
235 | /* |
|
ac73840b2117
[gaim-migrate @ 16271]
Mark Doliner <markdoliner@pidgin.im>
parents:
13694
diff
changeset
|
236 | * TODO: The friendly name was NULL for me when I |
|
ac73840b2117
[gaim-migrate @ 16271]
Mark Doliner <markdoliner@pidgin.im>
parents:
13694
diff
changeset
|
237 | * looked at this. Maybe we should use the store |
|
ac73840b2117
[gaim-migrate @ 16271]
Mark Doliner <markdoliner@pidgin.im>
parents:
13694
diff
changeset
|
238 | * name instead? --KingAnt |
|
ac73840b2117
[gaim-migrate @ 16271]
Mark Doliner <markdoliner@pidgin.im>
parents:
13694
diff
changeset
|
239 | */ |
| 13894 | 240 | // got_new_entry(gc, passport, friendly); |
|
9223
a23e96623e47
[gaim-migrate @ 10019]
Christian Hammond <chipx86@chipx86.com>
parents:
9218
diff
changeset
|
241 | } |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
242 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
243 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
244 | user->list_op |= (1 << list_id); |
| 15884 | 245 | /* purple_user_add_list_id (user, list_id); */ |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
246 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
247 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
248 | void |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
249 | msn_got_rem_user(MsnSession *session, MsnUser *user, |
| 13855 | 250 | MsnListId list_id, const char * group_id) |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
251 | { |
| 15884 | 252 | PurpleAccount *account; |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
253 | const char *passport; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
254 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
255 | account = session->account; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
256 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
257 | passport = msn_user_get_passport(user); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
258 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
259 | if (list_id == MSN_LIST_FL) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
260 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
261 | /* TODO: When is the user totally removed? */ |
|
20486
26b9f3efe52d
The last of the merge fix-ups.
Richard Laager <rlaager@pidgin.im>
parents:
20481
diff
changeset
|
262 | if (group_id != NULL) |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
263 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
264 | msn_user_remove_group_id(user, group_id); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
265 | return; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
266 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
267 | else |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
268 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
269 | /* session->sync->fl_users_count--; */ |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
270 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
271 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
272 | else if (list_id == MSN_LIST_AL) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
273 | { |
| 15884 | 274 | purple_privacy_permit_remove(account, passport, TRUE); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
275 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
276 | else if (list_id == MSN_LIST_BL) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
277 | { |
| 15884 | 278 | purple_privacy_deny_remove(account, passport, TRUE); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
279 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
280 | else if (list_id == MSN_LIST_RL) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
281 | { |
| 15884 | 282 | PurpleConversation *convo; |
|
11039
5ced3cea0867
[gaim-migrate @ 12938]
Richard Laager <rlaager@pidgin.im>
parents:
10774
diff
changeset
|
283 | |
| 15884 | 284 | purple_debug_info("msn", |
|
12318
942b7c089acb
[gaim-migrate @ 14622]
Richard Laager <rlaager@pidgin.im>
parents:
11638
diff
changeset
|
285 | "%s has removed you from his or her buddy list.\n", |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
286 | passport); |
|
11039
5ced3cea0867
[gaim-migrate @ 12938]
Richard Laager <rlaager@pidgin.im>
parents:
10774
diff
changeset
|
287 | |
| 15884 | 288 | convo = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, passport, account); |
|
11039
5ced3cea0867
[gaim-migrate @ 12938]
Richard Laager <rlaager@pidgin.im>
parents:
10774
diff
changeset
|
289 | if (convo) { |
| 15884 | 290 | PurpleBuddy *buddy; |
|
11039
5ced3cea0867
[gaim-migrate @ 12938]
Richard Laager <rlaager@pidgin.im>
parents:
10774
diff
changeset
|
291 | char *msg; |
|
5ced3cea0867
[gaim-migrate @ 12938]
Richard Laager <rlaager@pidgin.im>
parents:
10774
diff
changeset
|
292 | |
| 15884 | 293 | buddy = purple_find_buddy(account, passport); |
|
11039
5ced3cea0867
[gaim-migrate @ 12938]
Richard Laager <rlaager@pidgin.im>
parents:
10774
diff
changeset
|
294 | msg = g_strdup_printf( |
|
12318
942b7c089acb
[gaim-migrate @ 14622]
Richard Laager <rlaager@pidgin.im>
parents:
11638
diff
changeset
|
295 | _("%s has removed you from his or her buddy list."), |
| 15884 | 296 | buddy ? purple_buddy_get_contact_alias(buddy) : passport); |
| 297 | purple_conv_im_write(PURPLE_CONV_IM(convo), passport, msg, | |
| 298 | PURPLE_MESSAGE_SYSTEM, time(NULL)); | |
|
11039
5ced3cea0867
[gaim-migrate @ 12938]
Richard Laager <rlaager@pidgin.im>
parents:
10774
diff
changeset
|
299 | g_free(msg); |
|
5ced3cea0867
[gaim-migrate @ 12938]
Richard Laager <rlaager@pidgin.im>
parents:
10774
diff
changeset
|
300 | } |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
301 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
302 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
303 | user->list_op &= ~(1 << list_id); |
| 15884 | 304 | /* purple_user_remove_list_id (user, list_id); */ |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
305 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
306 | if (user->list_op == 0) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
307 | { |
| 15884 | 308 | purple_debug_info("msn", "Buddy '%s' shall be deleted?.\n", |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
309 | passport); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
310 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
311 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
312 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
313 | void |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
314 | msn_got_lst_user(MsnSession *session, MsnUser *user, |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
315 | int list_op, GSList *group_ids) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
316 | { |
| 15884 | 317 | PurpleConnection *gc; |
| 318 | PurpleAccount *account; | |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
319 | const char *passport; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
320 | const char *store; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
321 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
322 | account = session->account; |
| 15884 | 323 | gc = purple_account_get_connection(account); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
324 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
325 | passport = msn_user_get_passport(user); |
|
9211
4775b27b7a2c
[gaim-migrate @ 10006]
Christian Hammond <chipx86@chipx86.com>
parents:
9210
diff
changeset
|
326 | store = msn_user_get_store_name(user); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
327 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
328 | if (list_op & MSN_LIST_FL_OP) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
329 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
330 | GSList *c; |
|
20508
a8855578906a
Revert a bunch of whitespace changes so reviewing a diff against
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20489
diff
changeset
|
331 | for (c = group_ids; c != NULL; c = g_slist_next(c)) |
|
a8855578906a
Revert a bunch of whitespace changes so reviewing a diff against
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20489
diff
changeset
|
332 | { |
| 13856 | 333 | char *group_id; |
| 334 | group_id = c->data; | |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
335 | msn_user_add_group_id(user, group_id); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
336 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
337 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
338 | /* FIXME: It might be a real alias */ |
|
13449
8def834a5bea
[gaim-migrate @ 15823]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
13126
diff
changeset
|
339 | /* Umm, what? This might fix bug #1385130 */ |
|
8def834a5bea
[gaim-migrate @ 15823]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
13126
diff
changeset
|
340 | serv_got_alias(gc, passport, store); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
341 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
342 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
343 | if (list_op & MSN_LIST_AL_OP) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
344 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
345 | /* These are users who are allowed to see our status. */ |
| 15884 | 346 | purple_privacy_deny_remove(account, passport, TRUE); |
| 347 | purple_privacy_permit_add(account, passport, TRUE); | |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
348 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
349 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
350 | if (list_op & MSN_LIST_BL_OP) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
351 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
352 | /* These are users who are not allowed to see our status. */ |
| 15884 | 353 | purple_privacy_permit_remove(account, passport, TRUE); |
| 354 | purple_privacy_deny_add(account, passport, TRUE); | |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
355 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
356 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
357 | if (list_op & MSN_LIST_RL_OP) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
358 | { |
|
12318
942b7c089acb
[gaim-migrate @ 14622]
Richard Laager <rlaager@pidgin.im>
parents:
11638
diff
changeset
|
359 | /* These are users who have us on their buddy list. */ |
|
13829
ac73840b2117
[gaim-migrate @ 16271]
Mark Doliner <markdoliner@pidgin.im>
parents:
13694
diff
changeset
|
360 | /* |
|
ac73840b2117
[gaim-migrate @ 16271]
Mark Doliner <markdoliner@pidgin.im>
parents:
13694
diff
changeset
|
361 | * TODO: What is store name set to when this happens? |
|
ac73840b2117
[gaim-migrate @ 16271]
Mark Doliner <markdoliner@pidgin.im>
parents:
13694
diff
changeset
|
362 | * For one of my accounts "something@hotmail.com" |
|
ac73840b2117
[gaim-migrate @ 16271]
Mark Doliner <markdoliner@pidgin.im>
parents:
13694
diff
changeset
|
363 | * the store name was "something." Maybe we |
|
ac73840b2117
[gaim-migrate @ 16271]
Mark Doliner <markdoliner@pidgin.im>
parents:
13694
diff
changeset
|
364 | * should use the friendly name, instead? --KingAnt |
|
ac73840b2117
[gaim-migrate @ 16271]
Mark Doliner <markdoliner@pidgin.im>
parents:
13694
diff
changeset
|
365 | */ |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
366 | |
|
10583
6e191c459a4a
[gaim-migrate @ 11985]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10568
diff
changeset
|
367 | if (!(list_op & (MSN_LIST_AL_OP | MSN_LIST_BL_OP))) |
| 20489 | 368 | { |
|
20487
750502d6e968
Really the last of the merge changes.
Richard Laager <rlaager@pidgin.im>
parents:
20486
diff
changeset
|
369 | // got_new_entry(gc, passport, store); |
| 20489 | 370 | } |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
371 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
372 | |
| 13855 | 373 | user->list_op |= list_op; |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
374 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
375 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
376 | /************************************************************************** |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
377 | * UserList functions |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
378 | **************************************************************************/ |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
379 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
380 | MsnUserList* |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
381 | msn_userlist_new(MsnSession *session) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
382 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
383 | MsnUserList *userlist; |
|
9198
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9197
diff
changeset
|
384 | |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
385 | userlist = g_new0(MsnUserList, 1); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
386 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
387 | userlist->session = session; |
|
9860
8f54a6091294
[gaim-migrate @ 10739]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9857
diff
changeset
|
388 | userlist->buddy_icon_requests = g_queue_new(); |
|
13126
afce0fe97885
[gaim-migrate @ 15487]
Evan Schoenberg <evands@pidgin.im>
parents:
12381
diff
changeset
|
389 | |
|
afce0fe97885
[gaim-migrate @ 15487]
Evan Schoenberg <evands@pidgin.im>
parents:
12381
diff
changeset
|
390 | /* buddy_icon_window is the number of allowed simultaneous buddy icon requests. |
|
afce0fe97885
[gaim-migrate @ 15487]
Evan Schoenberg <evands@pidgin.im>
parents:
12381
diff
changeset
|
391 | * XXX With smarter rate limiting code, we could allow more at once... 5 was the limit set when |
|
afce0fe97885
[gaim-migrate @ 15487]
Evan Schoenberg <evands@pidgin.im>
parents:
12381
diff
changeset
|
392 | * we weren't retrieiving any more than 5 per MSN session. */ |
|
afce0fe97885
[gaim-migrate @ 15487]
Evan Schoenberg <evands@pidgin.im>
parents:
12381
diff
changeset
|
393 | userlist->buddy_icon_window = 1; |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
394 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
395 | return userlist; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
396 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
397 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
398 | void |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
399 | msn_userlist_destroy(MsnUserList *userlist) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
400 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
401 | GList *l; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
402 | |
| 13855 | 403 | /*destroy userlist*/ |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
404 | for (l = userlist->users; l != NULL; l = l->next) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
405 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
406 | msn_user_destroy(l->data); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
407 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
408 | g_list_free(userlist->users); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
409 | |
| 13855 | 410 | /*destroy group list*/ |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
411 | for (l = userlist->groups; l != NULL; l = l->next) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
412 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
413 | msn_group_destroy(l->data); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
414 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
415 | g_list_free(userlist->groups); |
|
9895
9ee0674ce68b
[gaim-migrate @ 10784]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9861
diff
changeset
|
416 | |
|
9ee0674ce68b
[gaim-migrate @ 10784]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9861
diff
changeset
|
417 | g_queue_free(userlist->buddy_icon_requests); |
|
13126
afce0fe97885
[gaim-migrate @ 15487]
Evan Schoenberg <evands@pidgin.im>
parents:
12381
diff
changeset
|
418 | |
|
afce0fe97885
[gaim-migrate @ 15487]
Evan Schoenberg <evands@pidgin.im>
parents:
12381
diff
changeset
|
419 | if (userlist->buddy_icon_request_timer) |
| 15884 | 420 | purple_timeout_remove(userlist->buddy_icon_request_timer); |
|
13126
afce0fe97885
[gaim-migrate @ 15487]
Evan Schoenberg <evands@pidgin.im>
parents:
12381
diff
changeset
|
421 | |
|
9857
56db8557dfed
[gaim-migrate @ 10736]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9225
diff
changeset
|
422 | g_free(userlist); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
423 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
424 | |
|
20473
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
425 | MsnUser * |
|
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
426 | msn_userlist_find_add_user(MsnUserList *userlist,const char *passport,const char *userName) |
|
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
427 | { |
|
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
428 | MsnUser *user; |
|
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
429 | |
|
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
430 | user = msn_userlist_find_user(userlist, passport); |
|
20479
03c44889c50f
Revert some whitespace changes.
Richard Laager <rlaager@pidgin.im>
parents:
20473
diff
changeset
|
431 | if (user == NULL) |
|
03c44889c50f
Revert some whitespace changes.
Richard Laager <rlaager@pidgin.im>
parents:
20473
diff
changeset
|
432 | { |
|
20473
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
433 | user = msn_user_new(userlist, passport, userName); |
|
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
434 | msn_userlist_add_user(userlist, user); |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
435 | } else { |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
436 | msn_user_set_store_name(user, userName); |
|
20473
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
437 | } |
|
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
438 | return user; |
|
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
439 | } |
|
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
440 | |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
441 | void |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
442 | msn_userlist_add_user(MsnUserList *userlist, MsnUser *user) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
443 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
444 | userlist->users = g_list_append(userlist->users, user); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
445 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
446 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
447 | void |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
448 | msn_userlist_remove_user(MsnUserList *userlist, MsnUser *user) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
449 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
450 | userlist->users = g_list_remove(userlist->users, user); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
451 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
452 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
453 | MsnUser * |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
454 | msn_userlist_find_user(MsnUserList *userlist, const char *passport) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
455 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
456 | GList *l; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
457 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
458 | g_return_val_if_fail(passport != NULL, NULL); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
459 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
460 | for (l = userlist->users; l != NULL; l = l->next) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
461 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
462 | MsnUser *user = (MsnUser *)l->data; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
463 | |
|
20478
46933dc62880
propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
diff
changeset
|
464 | // purple_debug_info("MsnUserList","user passport:%s,passport:%s\n",user->passport,passport); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
465 | g_return_val_if_fail(user->passport != NULL, NULL); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
466 | |
|
20473
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
467 | if (!g_strcasecmp(passport, user->passport)){ |
|
20478
46933dc62880
propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
diff
changeset
|
468 | // purple_debug_info("MsnUserList","return:%p\n",user); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
469 | return user; |
|
20473
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
470 | } |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
471 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
472 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
473 | return NULL; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
474 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
475 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
476 | void |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
477 | msn_userlist_add_group(MsnUserList *userlist, MsnGroup *group) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
478 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
479 | userlist->groups = g_list_append(userlist->groups, group); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
480 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
481 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
482 | void |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
483 | msn_userlist_remove_group(MsnUserList *userlist, MsnGroup *group) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
484 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
485 | userlist->groups = g_list_remove(userlist->groups, group); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
486 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
487 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
488 | MsnGroup * |
| 13855 | 489 | msn_userlist_find_group_with_id(MsnUserList *userlist, const char * id) |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
490 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
491 | GList *l; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
492 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
493 | g_return_val_if_fail(userlist != NULL, NULL); |
| 13855 | 494 | g_return_val_if_fail(id != NULL, NULL); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
495 | |
|
20508
a8855578906a
Revert a bunch of whitespace changes so reviewing a diff against
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20489
diff
changeset
|
496 | for (l = userlist->groups; l != NULL; l = l->next) |
|
a8855578906a
Revert a bunch of whitespace changes so reviewing a diff against
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20489
diff
changeset
|
497 | { |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
498 | MsnGroup *group = l->data; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
499 | |
|
20473
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
500 | if (!g_strcasecmp(group->id,id)) |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
501 | return group; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
502 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
503 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
504 | return NULL; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
505 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
506 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
507 | MsnGroup * |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
508 | msn_userlist_find_group_with_name(MsnUserList *userlist, const char *name) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
509 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
510 | GList *l; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
511 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
512 | g_return_val_if_fail(userlist != NULL, NULL); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
513 | g_return_val_if_fail(name != NULL, NULL); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
514 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
515 | for (l = userlist->groups; l != NULL; l = l->next) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
516 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
517 | MsnGroup *group = l->data; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
518 | |
| 13857 | 519 | if ((group->name != NULL) && !g_strcasecmp(name, group->name)) |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
520 | return group; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
521 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
522 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
523 | return NULL; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
524 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
525 | |
| 13855 | 526 | const char * |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
527 | msn_userlist_find_group_id(MsnUserList *userlist, const char *group_name) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
528 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
529 | MsnGroup *group; |
|
9198
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9197
diff
changeset
|
530 | |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
531 | group = msn_userlist_find_group_with_name(userlist, group_name); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
532 | |
|
20479
03c44889c50f
Revert some whitespace changes.
Richard Laager <rlaager@pidgin.im>
parents:
20473
diff
changeset
|
533 | if (group != NULL) |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
534 | return msn_group_get_id(group); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
535 | else |
| 13855 | 536 | return NULL; |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
537 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
538 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
539 | const char * |
| 13855 | 540 | msn_userlist_find_group_name(MsnUserList *userlist, const char * group_id) |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
541 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
542 | MsnGroup *group; |
|
9198
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9197
diff
changeset
|
543 | |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
544 | group = msn_userlist_find_group_with_id(userlist, group_id); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
545 | |
|
20479
03c44889c50f
Revert some whitespace changes.
Richard Laager <rlaager@pidgin.im>
parents:
20473
diff
changeset
|
546 | if (group != NULL) |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
547 | return msn_group_get_name(group); |
|
20479
03c44889c50f
Revert some whitespace changes.
Richard Laager <rlaager@pidgin.im>
parents:
20473
diff
changeset
|
548 | else |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
549 | return NULL; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
550 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
551 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
552 | void |
| 13855 | 553 | msn_userlist_rename_group_id(MsnUserList *userlist, const char * group_id, |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
554 | const char *new_name) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
555 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
556 | MsnGroup *group; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
557 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
558 | group = msn_userlist_find_group_with_id(userlist, group_id); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
559 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
560 | if (group != NULL) |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
561 | msn_group_set_name(group, new_name); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
562 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
563 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
564 | void |
| 13855 | 565 | msn_userlist_remove_group_id(MsnUserList *userlist, const char * group_id) |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
566 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
567 | MsnGroup *group; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
568 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
569 | group = msn_userlist_find_group_with_id(userlist, group_id); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
570 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
571 | if (group != NULL) |
|
10533
4c2ad22fad20
[gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10504
diff
changeset
|
572 | { |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
573 | msn_userlist_remove_group(userlist, group); |
|
10533
4c2ad22fad20
[gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10504
diff
changeset
|
574 | msn_group_destroy(group); |
|
4c2ad22fad20
[gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10504
diff
changeset
|
575 | } |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
576 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
577 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
578 | void |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
579 | msn_userlist_rem_buddy(MsnUserList *userlist, const char *who) |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
580 | { |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
581 | MsnUser *user = NULL; |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
582 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
583 | g_return_if_fail(userlist != NULL); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
584 | g_return_if_fail(userlist->session != NULL); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
585 | g_return_if_fail(userlist->session->contact != NULL); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
586 | g_return_if_fail(who != NULL); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
587 | |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
588 | user = msn_userlist_find_user(userlist, who); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
589 | |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
590 | msn_userlist_rem_buddy_from_list(userlist, who, MSN_LIST_FL); |
| 13866 | 591 | |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
592 | /* delete the contact from address book via soap action */ |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
593 | if (user != NULL) { |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
594 | msn_delete_contact(userlist->session->contact, user->uid); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
595 | } |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
596 | } |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
597 | |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
598 | void |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
599 | msn_userlist_rem_buddy_from_list(MsnUserList *userlist, const char *who, |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
600 | MsnListId list_id) |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
601 | { |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
602 | MsnUser *user; |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
603 | const gchar *list; |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
604 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
605 | user = msn_userlist_find_user(userlist, who); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
606 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
607 | g_return_if_fail(user != NULL); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
608 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
609 | if ( !msn_userlist_user_is_in_list(user, list_id)) { |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
610 | list = lists[list_id]; |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
611 | purple_debug_info("MSN Userlist", "User %s is not in list %s, not removing.\n", who, list); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
612 | return; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
613 | } |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
614 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
615 | msn_notification_rem_buddy_from_list(userlist->session->notification, list_id, who); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
616 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
617 | |
| 13861 | 618 | /*add buddy*/ |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
619 | void |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
620 | msn_userlist_add_buddy(MsnUserList *userlist, const char *who, |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
621 | const char *group_name) |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
622 | { |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
623 | MsnUser *user; |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
624 | MsnCallbackState *state = NULL; |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
625 | const char *group_id = NULL, *new_group_name; |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
626 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
627 | new_group_name = group_name == NULL ? MSN_INDIVIDUALS_GROUP_NAME : group_name; |
|
9194
1ff43e1a77e5
[gaim-migrate @ 9989]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
628 | |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
629 | g_return_if_fail(userlist != NULL); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
630 | g_return_if_fail(userlist->session != NULL); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
631 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
632 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
633 | purple_debug_info("MSN Userlist", "Add user: %s to group: %s\n", who, new_group_name); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
634 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
635 | state = msn_callback_state_new(); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
636 | msn_callback_state_set_who(state, who); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
637 | msn_callback_state_set_new_group_name(state, new_group_name); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
638 | |
| 15884 | 639 | if (!purple_email_is_valid(who)) |
|
11057
08abd0227bd2
[gaim-migrate @ 13009]
Jason Roth <jroth2@users.sourceforge.net>
parents:
11039
diff
changeset
|
640 | { |
|
11638
1821b40269a3
[gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11624
diff
changeset
|
641 | /* only notify the user about problems adding to the friends list |
|
1821b40269a3
[gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11624
diff
changeset
|
642 | * maybe we should do something else for other lists, but it probably |
|
1821b40269a3
[gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11624
diff
changeset
|
643 | * won't cause too many problems if we just ignore it */ |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
644 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
645 | char *str = g_strdup_printf(_("Unable to add \"%s\"."), who); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
646 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
647 | purple_notify_error(NULL, NULL, str, |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
648 | _("The screen name specified is invalid.")); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
649 | g_free(str); |
|
11638
1821b40269a3
[gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11624
diff
changeset
|
650 | |
|
11057
08abd0227bd2
[gaim-migrate @ 13009]
Jason Roth <jroth2@users.sourceforge.net>
parents:
11039
diff
changeset
|
651 | return; |
|
08abd0227bd2
[gaim-migrate @ 13009]
Jason Roth <jroth2@users.sourceforge.net>
parents:
11039
diff
changeset
|
652 | } |
|
08abd0227bd2
[gaim-migrate @ 13009]
Jason Roth <jroth2@users.sourceforge.net>
parents:
11039
diff
changeset
|
653 | |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
654 | group_id = msn_userlist_find_group_id(userlist, new_group_name); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
655 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
656 | if (group_id == NULL) |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
657 | { |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
658 | /* Whoa, we must add that group first. */ |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
659 | purple_debug_info("MSN Userlist", "Adding user %s to a new group, creating group %s first\n", who, new_group_name); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
660 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
661 | msn_callback_state_set_action(state, MSN_ADD_BUDDY); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
662 | |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
663 | msn_add_group(userlist->session, state, new_group_name); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
664 | return; |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
665 | } else { |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
666 | msn_callback_state_set_guid(state, group_id); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
667 | } |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
668 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
669 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
670 | user = msn_userlist_find_add_user(userlist, who, who); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
671 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
672 | if ( msn_userlist_user_is_in_list(user, MSN_LIST_FL) ) { |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
673 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
674 | purple_debug_info("MSN Userlist", "User %s already exists\n", who); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
675 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
676 | msn_userlist_rem_buddy_from_list(userlist, who, MSN_LIST_BL); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
677 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
678 | if (msn_userlist_user_is_in_group(user, group_id)) { |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
679 | purple_debug_info("MSN Userlist", "User %s is already in group %s, returning\n", who, new_group_name); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
680 | return; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
681 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
682 | } |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
683 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
684 | purple_debug_info("MSN Userlist", "Adding user: %s to group id: %s\n", who, group_id); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
685 | |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
686 | msn_callback_state_set_action(state, MSN_ADD_BUDDY); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
687 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
688 | /* Add contact in the Contact server with a SOAP request and if |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
689 | successful, send ADL with MSN_LIST_AL and MSN_LIST_FL and a FQY */ |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
690 | msn_add_contact_to_group(userlist->session->contact, state, who, group_id); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
691 | } |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
692 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
693 | void |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
694 | msn_userlist_add_buddy_to_list(MsnUserList *userlist, const char *who, |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
695 | MsnListId list_id) |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
696 | { |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
697 | MsnUser *user = NULL; |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
698 | const gchar *list; |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
699 | MsnListOp list_op = 1 << list_id; |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
700 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
701 | g_return_if_fail(userlist != NULL); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
702 | |
|
20522
177cad886d4c
A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20508
diff
changeset
|
703 | user = msn_userlist_find_add_user(userlist, who, who); |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
704 | |
|
9194
1ff43e1a77e5
[gaim-migrate @ 9989]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
705 | /* First we're going to check if it's already there. */ |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
706 | if (msn_userlist_user_is_in_list(user, list_id)) |
|
20479
03c44889c50f
Revert some whitespace changes.
Richard Laager <rlaager@pidgin.im>
parents:
20473
diff
changeset
|
707 | { |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
708 | list = lists[list_id]; |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
709 | purple_debug_info("MSN Userlist", "User '%s' is already in list: %s\n", who, list); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
710 | return; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
711 | } |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
712 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
713 | //store_name = (user != NULL) ? get_store_name(user) : who; |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
714 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
715 | //purple_debug_info("MSN Userlist", "store_name = %s\n", store_name); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
716 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
717 | /* XXX: see XXX above, this should really be done when we get the response from |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
718 | the server */ |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
719 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
720 | msn_user_set_op(user, list_op); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
721 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
722 | msn_notification_add_buddy_to_list(userlist->session->notification, list_id, who); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
723 | } |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
724 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
725 | gboolean |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
726 | msn_userlist_add_buddy_to_group(MsnUserList *userlist, const char *who, |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
727 | const char *group_name) |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
728 | { |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
729 | MsnUser *user; |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
730 | gchar * group_id; |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
731 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
732 | g_return_val_if_fail(userlist != NULL, FALSE); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
733 | g_return_val_if_fail(group_name != NULL, FALSE); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
734 | g_return_val_if_fail(who != NULL, FALSE); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
735 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
736 | purple_debug_info("MSN Userlist","Adding buddy with passport %s to group %s\n", who, group_name); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
737 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
738 | if ( (group_id = (gchar *)msn_userlist_find_group_id(userlist, group_name)) == NULL) { |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
739 | purple_debug_error("MSN Userlist", "Group %s has no guid!\n", group_name); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
740 | return FALSE; |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
741 | } |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
742 | |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
743 | if ( (user = msn_userlist_find_user(userlist, who)) == NULL) { |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
744 | purple_debug_error("MSN Userlist", "User %s not found!", who); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
745 | return FALSE; |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
746 | } |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
747 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
748 | msn_user_add_group_id(user, group_id); |
|
20560
79e9c94c34db
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20550
diff
changeset
|
749 | |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
750 | return TRUE; |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
751 | } |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
752 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
753 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
754 | gboolean |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
755 | msn_userlist_rem_buddy_from_group(MsnUserList *userlist, const char *who, |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
756 | const char *group_name) |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
757 | { |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
758 | const gchar * group_id; |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
759 | MsnUser *user; |
|
20522
177cad886d4c
A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20508
diff
changeset
|
760 | |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
761 | g_return_val_if_fail(userlist != NULL, FALSE); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
762 | g_return_val_if_fail(group_name != NULL, FALSE); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
763 | g_return_val_if_fail(who != NULL, FALSE); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
764 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
765 | purple_debug_info("MSN Userlist","Removing buddy with passport %s from group %s\n", who, group_name); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
766 | |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
767 | if ( (group_id = msn_userlist_find_group_id(userlist, group_name)) == NULL) { |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
768 | purple_debug_error("MSN Userlist", "Group %s has no guid!\n", group_name); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
769 | return FALSE; |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
770 | } |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
771 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
772 | if ( (user = msn_userlist_find_user(userlist, who)) == NULL) { |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
773 | purple_debug_error("MSN Userlist", "User %s not found!", who); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
774 | return FALSE; |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
775 | } |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
776 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
777 | msn_user_remove_group_id(user, group_id); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
778 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
779 | return TRUE; |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
780 | } |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
781 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
782 | void |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
783 | msn_userlist_move_buddy(MsnUserList *userlist, const char *who, |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
784 | const char *old_group_name, const char *new_group_name) |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
785 | { |
| 13856 | 786 | const char *new_group_id; |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
787 | MsnCallbackState *state = msn_callback_state_new(); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
788 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
789 | g_return_if_fail(userlist != NULL); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
790 | g_return_if_fail(userlist->session != NULL); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
791 | g_return_if_fail(userlist->session->contact != NULL); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
792 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
793 | msn_callback_state_set_who(state, who); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
794 | msn_callback_state_set_action(state, MSN_MOVE_BUDDY); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
795 | msn_callback_state_set_old_group_name(state, old_group_name); |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
796 | msn_callback_state_set_new_group_name(state, new_group_name); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
797 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
798 | new_group_id = msn_userlist_find_group_id(userlist, new_group_name); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
799 | |
|
20478
46933dc62880
propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
diff
changeset
|
800 | if (new_group_id == NULL) |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
801 | { |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
802 | msn_add_group(userlist->session, state, new_group_name); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
803 | return; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
804 | } |
|
20564
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
805 | |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
806 | /* add the contact to the new group, and remove it from the old one in |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
807 | * the callback |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
808 | */ |
|
35675dd4a44d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20560
diff
changeset
|
809 | msn_add_contact_to_group(userlist->session->contact, state, who, new_group_id); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
810 | } |
|
20473
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
811 | |
|
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
812 | /*load userlist from the Blist file cache*/ |
|
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
813 | void |
|
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
814 | msn_userlist_load(MsnSession *session) |
|
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
815 | { |
|
20478
46933dc62880
propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
diff
changeset
|
816 | PurpleBlistNode *gnode, *cnode, *bnode; |
|
46933dc62880
propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
diff
changeset
|
817 | PurpleConnection *gc = purple_account_get_connection(session->account); |
|
20473
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
818 | GSList *l; |
|
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
819 | MsnUser * user; |
|
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
820 | |
|
20546
35d778ab0450
Correctly process an additional <Service> with type Profile and name 'Messenger Roaming Identity' sent with the contact list using a recently registered WLM account, that was causing the initial ADL command to be sent malformed, and our presence status not being forwarded to our buddies
Carlos Silva <typ0@pidgin.im>
parents:
20531
diff
changeset
|
821 | purple_debug_info("::","msn_userlist_load()\n"); |
|
35d778ab0450
Correctly process an additional <Service> with type Profile and name 'Messenger Roaming Identity' sent with the contact list using a recently registered WLM account, that was causing the initial ADL command to be sent malformed, and our presence status not being forwarded to our buddies
Carlos Silva <typ0@pidgin.im>
parents:
20531
diff
changeset
|
822 | |
|
20473
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
823 | g_return_if_fail(gc != NULL); |
|
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
824 | |
|
20481
65485e2ed8a3
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4-rlaager-whitespace' (head df9df972434fafda3e8030977ab3c18d480d8fa8)
Richard Laager <rlaager@pidgin.im>
diff
changeset
|
825 | for (gnode = purple_get_blist()->root; gnode; gnode = gnode->next) |
|
20479
03c44889c50f
Revert some whitespace changes.
Richard Laager <rlaager@pidgin.im>
parents:
20473
diff
changeset
|
826 | { |
|
20481
65485e2ed8a3
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4-rlaager-whitespace' (head df9df972434fafda3e8030977ab3c18d480d8fa8)
Richard Laager <rlaager@pidgin.im>
diff
changeset
|
827 | if (!PURPLE_BLIST_NODE_IS_GROUP(gnode)) |
|
20473
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
828 | continue; |
|
20479
03c44889c50f
Revert some whitespace changes.
Richard Laager <rlaager@pidgin.im>
parents:
20473
diff
changeset
|
829 | for (cnode = gnode->child; cnode; cnode = cnode->next) |
|
03c44889c50f
Revert some whitespace changes.
Richard Laager <rlaager@pidgin.im>
parents:
20473
diff
changeset
|
830 | { |
|
20481
65485e2ed8a3
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4-rlaager-whitespace' (head df9df972434fafda3e8030977ab3c18d480d8fa8)
Richard Laager <rlaager@pidgin.im>
diff
changeset
|
831 | if (!PURPLE_BLIST_NODE_IS_CONTACT(cnode)) |
|
20473
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
832 | continue; |
|
20479
03c44889c50f
Revert some whitespace changes.
Richard Laager <rlaager@pidgin.im>
parents:
20473
diff
changeset
|
833 | for (bnode = cnode->child; bnode; bnode = bnode->next) |
|
03c44889c50f
Revert some whitespace changes.
Richard Laager <rlaager@pidgin.im>
parents:
20473
diff
changeset
|
834 | { |
|
20478
46933dc62880
propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
diff
changeset
|
835 | PurpleBuddy *b; |
|
20481
65485e2ed8a3
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4-rlaager-whitespace' (head df9df972434fafda3e8030977ab3c18d480d8fa8)
Richard Laager <rlaager@pidgin.im>
diff
changeset
|
836 | if (!PURPLE_BLIST_NODE_IS_BUDDY(bnode)) |
|
20473
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
837 | continue; |
|
20478
46933dc62880
propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
diff
changeset
|
838 | b = (PurpleBuddy *)bnode; |
|
20479
03c44889c50f
Revert some whitespace changes.
Richard Laager <rlaager@pidgin.im>
parents:
20473
diff
changeset
|
839 | if (b->account == gc->account) |
|
03c44889c50f
Revert some whitespace changes.
Richard Laager <rlaager@pidgin.im>
parents:
20473
diff
changeset
|
840 | { |
|
20473
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
841 | user = msn_userlist_find_add_user(session->userlist, |
|
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
842 | b->name,NULL); |
|
20475
0b3826f0e687
The first msn-p13-merge-head.diff.gz from SF Patch #1621854 from Ka-Hing Cheung.
Richard Laager <rlaager@pidgin.im>
parents:
20473
diff
changeset
|
843 | b->proto_data = user; |
|
0b3826f0e687
The first msn-p13-merge-head.diff.gz from SF Patch #1621854 from Ka-Hing Cheung.
Richard Laager <rlaager@pidgin.im>
parents:
20473
diff
changeset
|
844 | msn_user_set_op(user, MSN_LIST_FL_OP); |
|
20473
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
845 | } |
|
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
846 | } |
|
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
847 | } |
|
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
848 | } |
|
20479
03c44889c50f
Revert some whitespace changes.
Richard Laager <rlaager@pidgin.im>
parents:
20473
diff
changeset
|
849 | for (l = session->account->permit; l != NULL; l = l->next) |
|
03c44889c50f
Revert some whitespace changes.
Richard Laager <rlaager@pidgin.im>
parents:
20473
diff
changeset
|
850 | { |
|
20473
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
851 | user = msn_userlist_find_add_user(session->userlist, |
|
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
852 | (char *)l->data,NULL); |
|
20475
0b3826f0e687
The first msn-p13-merge-head.diff.gz from SF Patch #1621854 from Ka-Hing Cheung.
Richard Laager <rlaager@pidgin.im>
parents:
20473
diff
changeset
|
853 | msn_user_set_op(user, MSN_LIST_AL_OP); |
|
20473
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
854 | } |
|
20479
03c44889c50f
Revert some whitespace changes.
Richard Laager <rlaager@pidgin.im>
parents:
20473
diff
changeset
|
855 | for (l = session->account->deny; l != NULL; l = l->next) |
|
03c44889c50f
Revert some whitespace changes.
Richard Laager <rlaager@pidgin.im>
parents:
20473
diff
changeset
|
856 | { |
|
20473
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
857 | user = msn_userlist_find_add_user(session->userlist, |
|
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
858 | (char *)l->data,NULL); |
|
20475
0b3826f0e687
The first msn-p13-merge-head.diff.gz from SF Patch #1621854 from Ka-Hing Cheung.
Richard Laager <rlaager@pidgin.im>
parents:
20473
diff
changeset
|
859 | msn_user_set_op(user, MSN_LIST_BL_OP); |
|
20473
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
860 | } |
|
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
861 | |
|
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
862 | } |
|
91e1b3a49d10
msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents:
20472
diff
changeset
|
863 |