libpurple/protocols/msn/user.c

Mon, 13 Jul 2009 05:01:42 +0000

author
Elliott Sales de Andrade <qulogic@pidgin.im>
date
Mon, 13 Jul 2009 05:01:42 +0000
changeset 27776
60d79d68cde1
parent 27101
754a5afb2df7
child 27894
8985dc5213a4
child 28665
3ac533844419
permissions
-rw-r--r--

On MSN, pop up an "invite message" request similar to oscar, and send that
in the add request. We really should try and move this into the add buddy
dialog instead of an extra prompt.

Fixes #8503.

5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 /**
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
2 * @file user.c User functions
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
3 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15602
diff changeset
4 * purple
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
5 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15602
diff changeset
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: 9193
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: 9193
diff changeset
8 * source distribution.
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 5518
diff changeset
9 *
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
10 * This program is free software; you can redistribute it and/or modify
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
11 * it under the terms of the GNU General Public License as published by
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 * (at your option) any later version.
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 *
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 * This program is distributed in the hope that it will be useful,
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 * GNU General Public License for more details.
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19 *
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 * You should have received a copy of the GNU General Public License
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 * along with this program; if not, write to the Free Software
19859
71d37b57eff2 The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 16912
diff changeset
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
23 */
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
24 #include "msn.h"
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
25 #include "user.h"
9860
8f54a6091294 [gaim-migrate @ 10739]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9776
diff changeset
26 #include "slp.h"
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
27
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
28 /*new a user object*/
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
29 MsnUser *
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8475
diff changeset
30 msn_user_new(MsnUserList *userlist, const char *passport,
23783
cf52f8bc3b93 Remove MSN's use of a "store name" in favour of the "friendly name"
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23441
diff changeset
31 const char *friendly_name)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
32 {
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
33 MsnUser *user;
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
34
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8475
diff changeset
35 user = g_new0(MsnUser, 1);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
36
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8475
diff changeset
37 user->userlist = userlist;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
38
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8475
diff changeset
39 msn_user_set_passport(user, passport);
23783
cf52f8bc3b93 Remove MSN's use of a "store name" in favour of the "friendly name"
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23441
diff changeset
40 msn_user_set_friendly_name(user, friendly_name);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
41
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
42 return user;
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
43 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
44
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
45 /*destroy a user object*/
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
46 void
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
47 msn_user_destroy(MsnUser *user)
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
48 {
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
49 g_return_if_fail(user != NULL);
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
50
5475
a2f856cac665 [gaim-migrate @ 5871]
Christian Hammond <chipx86@chipx86.com>
parents: 5363
diff changeset
51 if (user->clientcaps != NULL)
a2f856cac665 [gaim-migrate @ 5871]
Christian Hammond <chipx86@chipx86.com>
parents: 5363
diff changeset
52 g_hash_table_destroy(user->clientcaps);
5316
ec9cbe50e70c [gaim-migrate @ 5688]
Christian Hammond <chipx86@chipx86.com>
parents: 5309
diff changeset
53
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 5518
diff changeset
54 if (user->group_ids != NULL)
20508
a8855578906a Revert a bunch of whitespace changes so reviewing a diff against
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20494
diff changeset
55 {
13899
495981413953 [gaim-migrate @ 17055]
Ma Yuan <mayuan2006@gmail.com>
parents: 13893
diff changeset
56 GList *l;
20508
a8855578906a Revert a bunch of whitespace changes so reviewing a diff against
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20494
diff changeset
57 for (l = user->group_ids; l != NULL; l = l->next)
a8855578906a Revert a bunch of whitespace changes so reviewing a diff against
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20494
diff changeset
58 {
13899
495981413953 [gaim-migrate @ 17055]
Ma Yuan <mayuan2006@gmail.com>
parents: 13893
diff changeset
59 g_free(l->data);
495981413953 [gaim-migrate @ 17055]
Ma Yuan <mayuan2006@gmail.com>
parents: 13893
diff changeset
60 }
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 5518
diff changeset
61 g_list_free(user->group_ids);
13899
495981413953 [gaim-migrate @ 17055]
Ma Yuan <mayuan2006@gmail.com>
parents: 13893
diff changeset
62 }
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 5518
diff changeset
63
6800
8f99c220b503 [gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents: 6788
diff changeset
64 if (user->msnobj != NULL)
8f99c220b503 [gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents: 6788
diff changeset
65 msn_object_destroy(user->msnobj);
8f99c220b503 [gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents: 6788
diff changeset
66
13695
64da09d24cbe [gaim-migrate @ 16096]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 12315
diff changeset
67 g_free(user->passport);
64da09d24cbe [gaim-migrate @ 16096]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 12315
diff changeset
68 g_free(user->friendly_name);
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
69 g_free(user->uid);
13695
64da09d24cbe [gaim-migrate @ 16096]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 12315
diff changeset
70 g_free(user->phone.home);
64da09d24cbe [gaim-migrate @ 16096]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 12315
diff changeset
71 g_free(user->phone.work);
64da09d24cbe [gaim-migrate @ 16096]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 12315
diff changeset
72 g_free(user->phone.mobile);
21193
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20597
diff changeset
73 g_free(user->media.artist);
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20597
diff changeset
74 g_free(user->media.title);
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20597
diff changeset
75 g_free(user->media.album);
21906
3827b1442a73 memleak fixes
Ka-Hing Cheung <khc@pidgin.im>
parents: 21453
diff changeset
76 g_free(user->statusline);
27101
754a5afb2df7 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25911
diff changeset
77 g_free(user->invite_message);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
78
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
79 g_free(user);
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
80 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
81
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
82 void
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
83 msn_user_update(MsnUser *user)
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
84 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15602
diff changeset
85 PurpleAccount *account;
23810
55d608317926 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23793
diff changeset
86 gboolean offline;
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
87
24169
e7a20691ba4e Don't crash if user == NULL in a couple more places. Not exactly the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23869
diff changeset
88 g_return_if_fail(user != NULL);
e7a20691ba4e Don't crash if user == NULL in a couple more places. Not exactly the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23869
diff changeset
89
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
90 account = user->userlist->session->account;
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
91
23810
55d608317926 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23793
diff changeset
92 offline = (user->status == NULL);
22711
16e50aae4932 some other mobile stuff that Maiku fixed, fixes #2359
Ka-Hing Cheung <khc@pidgin.im>
parents: 21906
diff changeset
93
23810
55d608317926 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23793
diff changeset
94 if (!offline) {
55d608317926 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23793
diff changeset
95 purple_prpl_got_user_status(account, user->passport, user->status,
55d608317926 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23793
diff changeset
96 "message", user->statusline, NULL);
55d608317926 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23793
diff changeset
97 } else {
55d608317926 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23793
diff changeset
98 if (user->mobile) {
55d608317926 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23793
diff changeset
99 purple_prpl_got_user_status(account, user->passport, "mobile", NULL);
55d608317926 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23793
diff changeset
100 purple_prpl_got_user_status(account, user->passport, "available", NULL);
22711
16e50aae4932 some other mobile stuff that Maiku fixed, fixes #2359
Ka-Hing Cheung <khc@pidgin.im>
parents: 21906
diff changeset
101 } else {
23810
55d608317926 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23793
diff changeset
102 purple_prpl_got_user_status(account, user->passport, "offline", NULL);
22711
16e50aae4932 some other mobile stuff that Maiku fixed, fixes #2359
Ka-Hing Cheung <khc@pidgin.im>
parents: 21906
diff changeset
103 }
23810
55d608317926 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23793
diff changeset
104 }
22711
16e50aae4932 some other mobile stuff that Maiku fixed, fixes #2359
Ka-Hing Cheung <khc@pidgin.im>
parents: 21906
diff changeset
105
23810
55d608317926 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23793
diff changeset
106 if (!offline || !user->mobile) {
55d608317926 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23793
diff changeset
107 purple_prpl_got_user_status_deactive(account, user->passport, "mobile");
55d608317926 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23793
diff changeset
108 }
21193
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20597
diff changeset
109
24771
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24169
diff changeset
110 if (!offline && user->media.type != CURRENT_MEDIA_UNKNOWN) {
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24169
diff changeset
111 if (user->media.type == CURRENT_MEDIA_MUSIC) {
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24169
diff changeset
112 purple_prpl_got_user_status(account, user->passport, "tune",
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24169
diff changeset
113 PURPLE_TUNE_ARTIST, user->media.artist,
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24169
diff changeset
114 PURPLE_TUNE_ALBUM, user->media.album,
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24169
diff changeset
115 PURPLE_TUNE_TITLE, user->media.title,
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24169
diff changeset
116 NULL);
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24169
diff changeset
117 } else if (user->media.type == CURRENT_MEDIA_GAMES) {
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24169
diff changeset
118 purple_prpl_got_user_status(account, user->passport, "tune",
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24169
diff changeset
119 "game", user->media.title,
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24169
diff changeset
120 NULL);
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24169
diff changeset
121 } else if (user->media.type == CURRENT_MEDIA_OFFICE) {
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24169
diff changeset
122 purple_prpl_got_user_status(account, user->passport, "tune",
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24169
diff changeset
123 "office", user->media.title,
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24169
diff changeset
124 NULL);
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24169
diff changeset
125 } else {
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24169
diff changeset
126 purple_debug_warning("msn", "Got CurrentMedia with unknown type %d.\n",
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24169
diff changeset
127 user->media.type);
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24169
diff changeset
128 }
23810
55d608317926 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23793
diff changeset
129 } else {
55d608317926 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23793
diff changeset
130 purple_prpl_got_user_status_deactive(account, user->passport, "tune");
15602
6d1d20a9e297 This is my attempt at MSN mobile status, but I suspect MSN mobile status doesn't exist. If it's confirmed that it doesn't, I'll revert this. But I want to keep it for posterity, in case it does exist
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
131 }
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
132
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
133 if (user->idle)
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15602
diff changeset
134 purple_prpl_got_user_idle(account, user->passport, TRUE, -1);
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
135 else
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15602
diff changeset
136 purple_prpl_got_user_idle(account, user->passport, FALSE, 0);
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
137 }
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
138
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
139 void
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
140 msn_user_set_state(MsnUser *user, const char *state)
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
141 {
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
142 const char *status;
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
143
24169
e7a20691ba4e Don't crash if user == NULL in a couple more places. Not exactly the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23869
diff changeset
144 g_return_if_fail(user != NULL);
e7a20691ba4e Don't crash if user == NULL in a couple more places. Not exactly the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23869
diff changeset
145
23810
55d608317926 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23793
diff changeset
146 if (state == NULL) {
55d608317926 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23793
diff changeset
147 user->status = NULL;
55d608317926 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23793
diff changeset
148 return;
55d608317926 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23793
diff changeset
149 }
55d608317926 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23793
diff changeset
150
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
151 if (!g_ascii_strcasecmp(state, "BSY"))
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
152 status = "busy";
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
153 else if (!g_ascii_strcasecmp(state, "BRB"))
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
154 status = "brb";
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
155 else if (!g_ascii_strcasecmp(state, "AWY"))
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
156 status = "away";
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
157 else if (!g_ascii_strcasecmp(state, "PHN"))
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
158 status = "phone";
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
159 else if (!g_ascii_strcasecmp(state, "LUN"))
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
160 status = "lunch";
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
161 else
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
162 status = "available";
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
163
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
164 if (!g_ascii_strcasecmp(state, "IDL"))
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
165 user->idle = TRUE;
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
166 else
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
167 user->idle = FALSE;
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
168
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
169 user->status = status;
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
170 }
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
171
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
172 void
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
173 msn_user_set_passport(MsnUser *user, const char *passport)
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
174 {
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
175 g_return_if_fail(user != NULL);
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
176
13695
64da09d24cbe [gaim-migrate @ 16096]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 12315
diff changeset
177 g_free(user->passport);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
178 user->passport = g_strdup(passport);
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
179 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
180
25533
e00f6966801d Move the check for whether to update the server alias out of nln_cmd and
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24779
diff changeset
181 gboolean
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8475
diff changeset
182 msn_user_set_friendly_name(MsnUser *user, const char *name)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
183 {
25558
94aa46eb4604 Fix this compile warning:
Mark Doliner <markdoliner@pidgin.im>
parents: 25533
diff changeset
184 g_return_val_if_fail(user != NULL, FALSE);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
185
25533
e00f6966801d Move the check for whether to update the server alias out of nln_cmd and
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24779
diff changeset
186 if (user->friendly_name && name && !strcmp(user->friendly_name, name))
e00f6966801d Move the check for whether to update the server alias out of nln_cmd and
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24779
diff changeset
187 return FALSE;
e00f6966801d Move the check for whether to update the server alias out of nln_cmd and
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24779
diff changeset
188
13695
64da09d24cbe [gaim-migrate @ 16096]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 12315
diff changeset
189 g_free(user->friendly_name);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8475
diff changeset
190 user->friendly_name = g_strdup(name);
25533
e00f6966801d Move the check for whether to update the server alias out of nln_cmd and
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24779
diff changeset
191
e00f6966801d Move the check for whether to update the server alias out of nln_cmd and
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24779
diff changeset
192 return TRUE;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8475
diff changeset
193 }
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
194
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8475
diff changeset
195 void
13888
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
196 msn_user_set_statusline(MsnUser *user, const char *statusline)
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
197 {
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
198 g_return_if_fail(user != NULL);
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
199
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
200 g_free(user->statusline);
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
201 user->statusline = g_strdup(statusline);
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
202 }
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
203
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
204 void
21193
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20597
diff changeset
205 msn_user_set_currentmedia(MsnUser *user, const CurrentMedia *media)
16183
92409c474659 Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@pidgin.im>
parents: 15884
diff changeset
206 {
92409c474659 Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@pidgin.im>
parents: 15884
diff changeset
207 g_return_if_fail(user != NULL);
92409c474659 Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@pidgin.im>
parents: 15884
diff changeset
208
21193
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20597
diff changeset
209 g_free(user->media.title);
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20597
diff changeset
210 g_free(user->media.album);
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20597
diff changeset
211 g_free(user->media.artist);
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20597
diff changeset
212
24771
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24169
diff changeset
213 user->media.type = media ? media->type : CURRENT_MEDIA_UNKNOWN;
21193
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20597
diff changeset
214 user->media.title = media ? g_strdup(media->title) : NULL;
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20597
diff changeset
215 user->media.artist = media ? g_strdup(media->artist) : NULL;
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20597
diff changeset
216 user->media.album = media ? g_strdup(media->album) : NULL;
16183
92409c474659 Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@pidgin.im>
parents: 15884
diff changeset
217 }
92409c474659 Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@pidgin.im>
parents: 15884
diff changeset
218
92409c474659 Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@pidgin.im>
parents: 15884
diff changeset
219 void
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
220 msn_user_set_uid(MsnUser *user, const char *uid)
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
221 {
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
222 g_return_if_fail(user != NULL);
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
223
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
224 g_free(user->uid);
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
225 user->uid = g_strdup(uid);
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
226 }
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
227
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
228 void
20508
a8855578906a Revert a bunch of whitespace changes so reviewing a diff against
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20494
diff changeset
229 msn_user_set_op(MsnUser *user, int list_op)
13910
fb8f57c2b934 [gaim-migrate @ 17481]
Ma Yuan <mayuan2006@gmail.com>
parents: 13900
diff changeset
230 {
20508
a8855578906a Revert a bunch of whitespace changes so reviewing a diff against
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20494
diff changeset
231 g_return_if_fail(user != NULL);
a8855578906a Revert a bunch of whitespace changes so reviewing a diff against
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20494
diff changeset
232
13910
fb8f57c2b934 [gaim-migrate @ 17481]
Ma Yuan <mayuan2006@gmail.com>
parents: 13900
diff changeset
233 user->list_op |= list_op;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
234 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
235
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
236 void
20569
66628c75dada Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
237 msn_user_unset_op(MsnUser *user, int list_op)
66628c75dada Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
238 {
66628c75dada Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
239 g_return_if_fail(user != NULL);
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 22737
diff changeset
240
20569
66628c75dada Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
241 user->list_op &= ~list_op;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
242 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
243
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
244 void
16538
c7e61e2917c9 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents: 15884
diff changeset
245 msn_user_set_buddy_icon(MsnUser *user, PurpleStoredImage *img)
7590
54b26062c7e0 [gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
246 {
22653
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 21906
diff changeset
247 MsnObject *msnobj;
7590
54b26062c7e0 [gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
248
54b26062c7e0 [gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
249 g_return_if_fail(user != NULL);
54b26062c7e0 [gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
250
22653
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 21906
diff changeset
251 msnobj = msn_object_new_from_image(img, "TFR2C2.tmp",
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 21906
diff changeset
252 user->passport, MSN_OBJECT_USERTILE);
7590
54b26062c7e0 [gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
253
22653
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 21906
diff changeset
254 if (!msnobj)
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 21906
diff changeset
255 purple_debug_error("msn", "Unable to open buddy icon from %s!\n", user->passport);
7590
54b26062c7e0 [gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
256
22653
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 21906
diff changeset
257 msn_user_set_object(user, msnobj);
7590
54b26062c7e0 [gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
258 }
54b26062c7e0 [gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
259
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
260 /*add group id to User object*/
7590
54b26062c7e0 [gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
261 void
23869
e650ca347f69 Fix a double free when connecting to the sender of a bonjour file fails. Also plug a small leak. Fixes #5971.
Daniel Atallah <datallah@pidgin.im>
parents: 23830
diff changeset
262 msn_user_add_group_id(MsnUser *user, const char* group_id)
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 5518
diff changeset
263 {
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8475
diff changeset
264 MsnUserList *userlist;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15602
diff changeset
265 PurpleAccount *account;
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15602
diff changeset
266 PurpleBuddy *b;
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15602
diff changeset
267 PurpleGroup *g;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8475
diff changeset
268 const char *passport;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8475
diff changeset
269 const char *group_name;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8475
diff changeset
270
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 5518
diff changeset
271 g_return_if_fail(user != NULL);
23869
e650ca347f69 Fix a double free when connecting to the sender of a bonjour file fails. Also plug a small leak. Fixes #5971.
Daniel Atallah <datallah@pidgin.im>
parents: 23830
diff changeset
272 g_return_if_fail(group_id != NULL);
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 5518
diff changeset
273
23869
e650ca347f69 Fix a double free when connecting to the sender of a bonjour file fails. Also plug a small leak. Fixes #5971.
Daniel Atallah <datallah@pidgin.im>
parents: 23830
diff changeset
274 user->group_ids = g_list_append(user->group_ids, g_strdup(group_id));
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8475
diff changeset
275
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8475
diff changeset
276 userlist = user->userlist;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8475
diff changeset
277 account = userlist->session->account;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8475
diff changeset
278 passport = msn_user_get_passport(user);
9198
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9193
diff changeset
279
13899
495981413953 [gaim-migrate @ 17055]
Ma Yuan <mayuan2006@gmail.com>
parents: 13893
diff changeset
280 group_name = msn_userlist_find_group_name(userlist, group_id);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8475
diff changeset
281
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23810
diff changeset
282 purple_debug_info("msn", "User: group id:%s,name:%s,user:%s\n", group_id, group_name, passport);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8475
diff changeset
283
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15602
diff changeset
284 g = purple_find_group(group_name);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8475
diff changeset
285
23869
e650ca347f69 Fix a double free when connecting to the sender of a bonjour file fails. Also plug a small leak. Fixes #5971.
Daniel Atallah <datallah@pidgin.im>
parents: 23830
diff changeset
286 if ((group_id == NULL) && (g == NULL))
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
287 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15602
diff changeset
288 g = purple_group_new(group_name);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15602
diff changeset
289 purple_blist_add_group(g, NULL);
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
290 }
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10388
diff changeset
291
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15602
diff changeset
292 b = purple_find_buddy_in_group(account, passport, g);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8475
diff changeset
293 if (b == NULL)
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8475
diff changeset
294 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15602
diff changeset
295 b = purple_buddy_new(account, passport, NULL);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15602
diff changeset
296 purple_blist_add_buddy(b, NULL, g, NULL);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8475
diff changeset
297 }
24946
390536329dc5 Some more PurpleBuddy::proto_data related changes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24169
diff changeset
298 purple_buddy_set_protocol_data(b, user);
13910
fb8f57c2b934 [gaim-migrate @ 17481]
Ma Yuan <mayuan2006@gmail.com>
parents: 13900
diff changeset
299 /*Update the blist Node info*/
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 5518
diff changeset
300 }
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8475
diff changeset
301
13893
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
302 /*check if the msn user is online*/
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
303 gboolean
20478
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20474 15884
diff changeset
304 msn_user_is_online(PurpleAccount *account, const char *name)
13893
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
305 {
20478
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20474 15884
diff changeset
306 PurpleBuddy *buddy;
13893
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
307
24169
e7a20691ba4e Don't crash if user == NULL in a couple more places. Not exactly the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23869
diff changeset
308 buddy = purple_find_buddy(account, name);
20478
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20474 15884
diff changeset
309 return PURPLE_BUDDY_IS_ONLINE(buddy);
13893
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
310 }
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
311
13900
ce507a208510 [gaim-migrate @ 17056]
Ma Yuan <mayuan2006@gmail.com>
parents: 13899
diff changeset
312 gboolean
20519
35db99dd2ece Fix msn_user_remove_group_id()
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20508
diff changeset
313 msn_user_is_yahoo(PurpleAccount *account, const char *name)
13900
ce507a208510 [gaim-migrate @ 17056]
Ma Yuan <mayuan2006@gmail.com>
parents: 13899
diff changeset
314 {
20530
0178f0d66bf0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20528
diff changeset
315 MsnSession *session = NULL;
0178f0d66bf0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20528
diff changeset
316 MsnUser *user;
0178f0d66bf0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20528
diff changeset
317 PurpleConnection *gc;
0178f0d66bf0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20528
diff changeset
318
0178f0d66bf0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20528
diff changeset
319 gc = purple_account_get_connection(account);
0178f0d66bf0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20528
diff changeset
320 if (gc != NULL)
0178f0d66bf0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20528
diff changeset
321 session = gc->proto_data;
0178f0d66bf0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20528
diff changeset
322
0178f0d66bf0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20528
diff changeset
323 if ((session != NULL) && (user = msn_userlist_find_user(session->userlist, name)) != NULL)
0178f0d66bf0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20528
diff changeset
324 {
23790
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
325 return (user->networkid == MSN_NETWORK_YAHOO);
20530
0178f0d66bf0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20528
diff changeset
326 }
0178f0d66bf0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20528
diff changeset
327 return (strstr(name,"@yahoo.") != NULL);
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 5518
diff changeset
328 }
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 5518
diff changeset
329
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 5518
diff changeset
330 void
20519
35db99dd2ece Fix msn_user_remove_group_id()
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20508
diff changeset
331 msn_user_remove_group_id(MsnUser *user, const char *id)
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 5518
diff changeset
332 {
20519
35db99dd2ece Fix msn_user_remove_group_id()
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20508
diff changeset
333 GList *l;
35db99dd2ece Fix msn_user_remove_group_id()
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20508
diff changeset
334
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 5518
diff changeset
335 g_return_if_fail(user != NULL);
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
336 g_return_if_fail(id != NULL);
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 5518
diff changeset
337
20519
35db99dd2ece Fix msn_user_remove_group_id()
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20508
diff changeset
338 l = g_list_find_custom(user->group_ids, id, (GCompareFunc)strcmp);
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 5518
diff changeset
339
20519
35db99dd2ece Fix msn_user_remove_group_id()
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20508
diff changeset
340 if (l == NULL)
35db99dd2ece Fix msn_user_remove_group_id()
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20508
diff changeset
341 return;
35db99dd2ece Fix msn_user_remove_group_id()
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20508
diff changeset
342
35db99dd2ece Fix msn_user_remove_group_id()
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20508
diff changeset
343 g_free(l->data);
21063
911e85f207c7 Fix some leaks caused by misuse of g_list_remove_link() instead of g_list_delete_link().
Daniel Atallah <datallah@pidgin.im>
parents: 21029
diff changeset
344 user->group_ids = g_list_delete_link(user->group_ids, l);
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 5518
diff changeset
345 }
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8475
diff changeset
346
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 5518
diff changeset
347 void
24779
b348af6b49a9 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24771
diff changeset
348 msn_user_set_pending_group(MsnUser *user, const char *group)
b348af6b49a9 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24771
diff changeset
349 {
b348af6b49a9 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24771
diff changeset
350 user->pending_group = g_strdup(group);
b348af6b49a9 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24771
diff changeset
351 }
b348af6b49a9 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24771
diff changeset
352
b348af6b49a9 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24771
diff changeset
353 char *
b348af6b49a9 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24771
diff changeset
354 msn_user_remove_pending_group(MsnUser *user)
b348af6b49a9 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24771
diff changeset
355 {
b348af6b49a9 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24771
diff changeset
356 char *group = user->pending_group;
b348af6b49a9 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24771
diff changeset
357 user->pending_group = NULL;
b348af6b49a9 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24771
diff changeset
358 return group;
b348af6b49a9 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24771
diff changeset
359 }
b348af6b49a9 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24771
diff changeset
360
b348af6b49a9 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24771
diff changeset
361 void
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
362 msn_user_set_home_phone(MsnUser *user, const char *number)
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
363 {
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
364 g_return_if_fail(user != NULL);
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
365
21067
97a745428ab0 Cleanup some unnecessary NULL checks in g_strdup()/g_free().
Daniel Atallah <datallah@pidgin.im>
parents: 21063
diff changeset
366 g_free(user->phone.home);
97a745428ab0 Cleanup some unnecessary NULL checks in g_strdup()/g_free().
Daniel Atallah <datallah@pidgin.im>
parents: 21063
diff changeset
367 user->phone.home = g_strdup(number);
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
368 }
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
369
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
370 void
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
371 msn_user_set_work_phone(MsnUser *user, const char *number)
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
372 {
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
373 g_return_if_fail(user != NULL);
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
374
21067
97a745428ab0 Cleanup some unnecessary NULL checks in g_strdup()/g_free().
Daniel Atallah <datallah@pidgin.im>
parents: 21063
diff changeset
375 g_free(user->phone.work);
97a745428ab0 Cleanup some unnecessary NULL checks in g_strdup()/g_free().
Daniel Atallah <datallah@pidgin.im>
parents: 21063
diff changeset
376 user->phone.work = g_strdup(number);
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
377 }
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
378
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
379 void
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
380 msn_user_set_mobile_phone(MsnUser *user, const char *number)
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
381 {
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
382 g_return_if_fail(user != NULL);
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
383
21067
97a745428ab0 Cleanup some unnecessary NULL checks in g_strdup()/g_free().
Daniel Atallah <datallah@pidgin.im>
parents: 21063
diff changeset
384 g_free(user->phone.mobile);
97a745428ab0 Cleanup some unnecessary NULL checks in g_strdup()/g_free().
Daniel Atallah <datallah@pidgin.im>
parents: 21063
diff changeset
385 user->phone.mobile = g_strdup(number);
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
386 }
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
387
6788
26d148d26f2f [gaim-migrate @ 7327]
Christian Hammond <chipx86@chipx86.com>
parents: 6701
diff changeset
388 void
23790
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
389 msn_user_set_clientid(MsnUser *user, guint clientid)
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
390 {
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
391 g_return_if_fail(user != NULL);
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
392
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
393 user->clientid = clientid;
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
394 }
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
395
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
396 void
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
397 msn_user_set_network(MsnUser *user, MsnNetwork network)
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
398 {
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
399 g_return_if_fail(user != NULL);
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
400
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
401 user->networkid = network;
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
402 }
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
403
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
404 void
6788
26d148d26f2f [gaim-migrate @ 7327]
Christian Hammond <chipx86@chipx86.com>
parents: 6701
diff changeset
405 msn_user_set_object(MsnUser *user, MsnObject *obj)
26d148d26f2f [gaim-migrate @ 7327]
Christian Hammond <chipx86@chipx86.com>
parents: 6701
diff changeset
406 {
26d148d26f2f [gaim-migrate @ 7327]
Christian Hammond <chipx86@chipx86.com>
parents: 6701
diff changeset
407 g_return_if_fail(user != NULL);
26d148d26f2f [gaim-migrate @ 7327]
Christian Hammond <chipx86@chipx86.com>
parents: 6701
diff changeset
408
26d148d26f2f [gaim-migrate @ 7327]
Christian Hammond <chipx86@chipx86.com>
parents: 6701
diff changeset
409 if (user->msnobj != NULL)
26d148d26f2f [gaim-migrate @ 7327]
Christian Hammond <chipx86@chipx86.com>
parents: 6701
diff changeset
410 msn_object_destroy(user->msnobj);
26d148d26f2f [gaim-migrate @ 7327]
Christian Hammond <chipx86@chipx86.com>
parents: 6701
diff changeset
411
26d148d26f2f [gaim-migrate @ 7327]
Christian Hammond <chipx86@chipx86.com>
parents: 6701
diff changeset
412 user->msnobj = obj;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8475
diff changeset
413
9860
8f54a6091294 [gaim-migrate @ 10739]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9776
diff changeset
414 if (user->list_op & MSN_LIST_FL_OP)
8f54a6091294 [gaim-migrate @ 10739]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9776
diff changeset
415 msn_queue_buddy_icon_request(user);
6788
26d148d26f2f [gaim-migrate @ 7327]
Christian Hammond <chipx86@chipx86.com>
parents: 6701
diff changeset
416 }
26d148d26f2f [gaim-migrate @ 7327]
Christian Hammond <chipx86@chipx86.com>
parents: 6701
diff changeset
417
26d148d26f2f [gaim-migrate @ 7327]
Christian Hammond <chipx86@chipx86.com>
parents: 6701
diff changeset
418 void
26d148d26f2f [gaim-migrate @ 7327]
Christian Hammond <chipx86@chipx86.com>
parents: 6701
diff changeset
419 msn_user_set_client_caps(MsnUser *user, GHashTable *info)
26d148d26f2f [gaim-migrate @ 7327]
Christian Hammond <chipx86@chipx86.com>
parents: 6701
diff changeset
420 {
26d148d26f2f [gaim-migrate @ 7327]
Christian Hammond <chipx86@chipx86.com>
parents: 6701
diff changeset
421 g_return_if_fail(user != NULL);
26d148d26f2f [gaim-migrate @ 7327]
Christian Hammond <chipx86@chipx86.com>
parents: 6701
diff changeset
422 g_return_if_fail(info != NULL);
26d148d26f2f [gaim-migrate @ 7327]
Christian Hammond <chipx86@chipx86.com>
parents: 6701
diff changeset
423
26d148d26f2f [gaim-migrate @ 7327]
Christian Hammond <chipx86@chipx86.com>
parents: 6701
diff changeset
424 if (user->clientcaps != NULL)
26d148d26f2f [gaim-migrate @ 7327]
Christian Hammond <chipx86@chipx86.com>
parents: 6701
diff changeset
425 g_hash_table_destroy(user->clientcaps);
26d148d26f2f [gaim-migrate @ 7327]
Christian Hammond <chipx86@chipx86.com>
parents: 6701
diff changeset
426
26d148d26f2f [gaim-migrate @ 7327]
Christian Hammond <chipx86@chipx86.com>
parents: 6701
diff changeset
427 user->clientcaps = info;
26d148d26f2f [gaim-migrate @ 7327]
Christian Hammond <chipx86@chipx86.com>
parents: 6701
diff changeset
428 }
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
429
27101
754a5afb2df7 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25911
diff changeset
430 void
754a5afb2df7 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25911
diff changeset
431 msn_user_set_invite_message(MsnUser *user, const char *message)
754a5afb2df7 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25911
diff changeset
432 {
754a5afb2df7 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25911
diff changeset
433 g_return_if_fail(user != NULL);
754a5afb2df7 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25911
diff changeset
434
754a5afb2df7 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25911
diff changeset
435 g_free(user->invite_message);
754a5afb2df7 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25911
diff changeset
436 user->invite_message = g_strdup(message);
754a5afb2df7 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25911
diff changeset
437 }
754a5afb2df7 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25911
diff changeset
438
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
439 const char *
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
440 msn_user_get_passport(const MsnUser *user)
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
441 {
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
442 g_return_val_if_fail(user != NULL, NULL);
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
443
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
444 return user->passport;
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
445 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
446
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
447 const char *
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8475
diff changeset
448 msn_user_get_friendly_name(const MsnUser *user)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
449 {
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
450 g_return_val_if_fail(user != NULL, NULL);
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
451
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8475
diff changeset
452 return user->friendly_name;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
453 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
454
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8475
diff changeset
455 const char *
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
456 msn_user_get_home_phone(const MsnUser *user)
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
457 {
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
458 g_return_val_if_fail(user != NULL, NULL);
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
459
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
460 return user->phone.home;
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
461 }
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
462
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
463 const char *
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
464 msn_user_get_work_phone(const MsnUser *user)
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
465 {
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
466 g_return_val_if_fail(user != NULL, NULL);
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
467
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
468 return user->phone.work;
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
469 }
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
470
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
471 const char *
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
472 msn_user_get_mobile_phone(const MsnUser *user)
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
473 {
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
474 g_return_val_if_fail(user != NULL, NULL);
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
475
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
476 return user->phone.mobile;
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
477 }
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5316
diff changeset
478
23790
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
479 guint
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
480 msn_user_get_clientid(const MsnUser *user)
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
481 {
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
482 g_return_val_if_fail(user != NULL, 0);
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
483
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
484 return user->clientid;
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
485 }
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
486
6788
26d148d26f2f [gaim-migrate @ 7327]
Christian Hammond <chipx86@chipx86.com>
parents: 6701
diff changeset
487 MsnObject *
26d148d26f2f [gaim-migrate @ 7327]
Christian Hammond <chipx86@chipx86.com>
parents: 6701
diff changeset
488 msn_user_get_object(const MsnUser *user)
5316
ec9cbe50e70c [gaim-migrate @ 5688]
Christian Hammond <chipx86@chipx86.com>
parents: 5309
diff changeset
489 {
6788
26d148d26f2f [gaim-migrate @ 7327]
Christian Hammond <chipx86@chipx86.com>
parents: 6701
diff changeset
490 g_return_val_if_fail(user != NULL, NULL);
5316
ec9cbe50e70c [gaim-migrate @ 5688]
Christian Hammond <chipx86@chipx86.com>
parents: 5309
diff changeset
491
6788
26d148d26f2f [gaim-migrate @ 7327]
Christian Hammond <chipx86@chipx86.com>
parents: 6701
diff changeset
492 return user->msnobj;
5316
ec9cbe50e70c [gaim-migrate @ 5688]
Christian Hammond <chipx86@chipx86.com>
parents: 5309
diff changeset
493 }
ec9cbe50e70c [gaim-migrate @ 5688]
Christian Hammond <chipx86@chipx86.com>
parents: 5309
diff changeset
494
ec9cbe50e70c [gaim-migrate @ 5688]
Christian Hammond <chipx86@chipx86.com>
parents: 5309
diff changeset
495 GHashTable *
5475
a2f856cac665 [gaim-migrate @ 5871]
Christian Hammond <chipx86@chipx86.com>
parents: 5363
diff changeset
496 msn_user_get_client_caps(const MsnUser *user)
5316
ec9cbe50e70c [gaim-migrate @ 5688]
Christian Hammond <chipx86@chipx86.com>
parents: 5309
diff changeset
497 {
ec9cbe50e70c [gaim-migrate @ 5688]
Christian Hammond <chipx86@chipx86.com>
parents: 5309
diff changeset
498 g_return_val_if_fail(user != NULL, NULL);
ec9cbe50e70c [gaim-migrate @ 5688]
Christian Hammond <chipx86@chipx86.com>
parents: 5309
diff changeset
499
5475
a2f856cac665 [gaim-migrate @ 5871]
Christian Hammond <chipx86@chipx86.com>
parents: 5363
diff changeset
500 return user->clientcaps;
5316
ec9cbe50e70c [gaim-migrate @ 5688]
Christian Hammond <chipx86@chipx86.com>
parents: 5309
diff changeset
501 }
27101
754a5afb2df7 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25911
diff changeset
502
754a5afb2df7 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25911
diff changeset
503 const char *
754a5afb2df7 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25911
diff changeset
504 msn_user_get_invite_message(const MsnUser *user)
754a5afb2df7 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25911
diff changeset
505 {
754a5afb2df7 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25911
diff changeset
506 g_return_val_if_fail(user != NULL, NULL);
754a5afb2df7 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25911
diff changeset
507
754a5afb2df7 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25911
diff changeset
508 return user->invite_message;
754a5afb2df7 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25911
diff changeset
509 }
754a5afb2df7 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25911
diff changeset
510

mercurial