annotate libpurple/protocols/msn/user.c @ 29351:08296b862f98

Move the three phone numbers from the MsnUser struct into a separate struct that gets added as needed. Makes MsnUser smaller by 2 pointers. In practice nobody has phone numbers
author Mark Doliner <mark@kingant.net>
date Thu, 04 Feb 2010 00:35:15 +0000
parents 99d1b433dba0
children 746bf7d8b34e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2 * @file user.c User functions
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3 *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15541
diff changeset
4 * purple
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5 *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15541
diff changeset
6 * Purple is the legal property of its developers, whose names are too numerous
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
7 * to list here. Please refer to the COPYRIGHT file distributed with this
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
8 * source distribution.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
9 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
10 * This program is free software; you can redistribute it and/or modify
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
11 * it under the terms of the GNU General Public License as published by
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
13 * (at your option) any later version.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
14 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
15 * This program is distributed in the hope that it will be useful,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
18 * GNU General Public License for more details.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
19 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
20 * You should have received a copy of the GNU General Public License
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
21 * along with this program; if not, write to the Free Software
19680
44b4e8bd759b The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 16867
diff changeset
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
23 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
24 #include "msn.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
25 #include "user.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
26 #include "slp.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
27
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
28 /*new a user object*/
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
29 MsnUser *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
30 msn_user_new(MsnUserList *userlist, const char *passport,
23516
5a6cf27ead31 Remove MSN's use of a "store name" in favour of the "friendly name"
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23300
diff changeset
31 const char *friendly_name)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
32 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
33 MsnUser *user;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
34
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
35 user = g_new0(MsnUser, 1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
36
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
37 user->userlist = userlist;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
38
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
39 msn_user_set_passport(user, passport);
23516
5a6cf27ead31 Remove MSN's use of a "store name" in favour of the "friendly name"
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23300
diff changeset
40 msn_user_set_friendly_name(user, friendly_name);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
41
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
42 return user;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
43 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
44
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
45 /*destroy a user object*/
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
46 void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
47 msn_user_destroy(MsnUser *user)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
48 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
49 g_return_if_fail(user != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
50
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
51 if (user->clientcaps != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
52 g_hash_table_destroy(user->clientcaps);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
53
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
54 if (user->group_ids != NULL)
20425
5048651671e1 Revert a bunch of whitespace changes so reviewing a diff against
Stu Tomlinson <stu@nosnilmot.com>
parents: 20411
diff changeset
55 {
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
56 GList *l;
20425
5048651671e1 Revert a bunch of whitespace changes so reviewing a diff against
Stu Tomlinson <stu@nosnilmot.com>
parents: 20411
diff changeset
57 for (l = user->group_ids; l != NULL; l = l->next)
5048651671e1 Revert a bunch of whitespace changes so reviewing a diff against
Stu Tomlinson <stu@nosnilmot.com>
parents: 20411
diff changeset
58 {
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
59 g_free(l->data);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
60 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
61 g_list_free(user->group_ids);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
62 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
63
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
64 if (user->msnobj != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
65 msn_object_destroy(user->msnobj);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
66
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
67 g_free(user->passport);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
68 g_free(user->friendly_name);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
69 g_free(user->uid);
29351
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
70 if (user->phone) {
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
71 g_free(user->phone->home);
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
72 g_free(user->phone->work);
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
73 g_free(user->phone->mobile);
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
74 g_free(user->phone);
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
75 }
29350
99d1b433dba0 Keep CurrentMedia in a separate object outside of MsnUser that needs to
Mark Doliner <mark@kingant.net>
parents: 28738
diff changeset
76 if (user->media) {
99d1b433dba0 Keep CurrentMedia in a separate object outside of MsnUser that needs to
Mark Doliner <mark@kingant.net>
parents: 28738
diff changeset
77 g_free(user->media->artist);
99d1b433dba0 Keep CurrentMedia in a separate object outside of MsnUser that needs to
Mark Doliner <mark@kingant.net>
parents: 28738
diff changeset
78 g_free(user->media->title);
99d1b433dba0 Keep CurrentMedia in a separate object outside of MsnUser that needs to
Mark Doliner <mark@kingant.net>
parents: 28738
diff changeset
79 g_free(user->media->album);
99d1b433dba0 Keep CurrentMedia in a separate object outside of MsnUser that needs to
Mark Doliner <mark@kingant.net>
parents: 28738
diff changeset
80 g_free(user->media);
99d1b433dba0 Keep CurrentMedia in a separate object outside of MsnUser that needs to
Mark Doliner <mark@kingant.net>
parents: 28738
diff changeset
81 }
21791
c80d0732fa40 memleak fixes
Ka-Hing Cheung <khc@hxbc.us>
parents: 21284
diff changeset
82 g_free(user->statusline);
26991
2a95e8bd9b80 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25438
diff changeset
83 g_free(user->invite_message);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
84
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
85 g_free(user);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
86 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
87
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
88 void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
89 msn_user_update(MsnUser *user)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
90 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15541
diff changeset
91 PurpleAccount *account;
23543
80d09f42b157 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23526
diff changeset
92 gboolean offline;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
93
23876
169c1451b7e5 Don't crash if user == NULL in a couple more places. Not exactly the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23602
diff changeset
94 g_return_if_fail(user != NULL);
169c1451b7e5 Don't crash if user == NULL in a couple more places. Not exactly the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23602
diff changeset
95
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
96 account = user->userlist->session->account;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
97
23543
80d09f42b157 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23526
diff changeset
98 offline = (user->status == NULL);
22553
1168dc635ac1 some other mobile stuff that Maiku fixed, fixes #2359
Ka-Hing Cheung <khc@hxbc.us>
parents: 21791
diff changeset
99
23543
80d09f42b157 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23526
diff changeset
100 if (!offline) {
80d09f42b157 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23526
diff changeset
101 purple_prpl_got_user_status(account, user->passport, user->status,
80d09f42b157 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23526
diff changeset
102 "message", user->statusline, NULL);
80d09f42b157 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23526
diff changeset
103 } else {
80d09f42b157 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23526
diff changeset
104 if (user->mobile) {
80d09f42b157 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23526
diff changeset
105 purple_prpl_got_user_status(account, user->passport, "mobile", NULL);
80d09f42b157 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23526
diff changeset
106 purple_prpl_got_user_status(account, user->passport, "available", NULL);
22553
1168dc635ac1 some other mobile stuff that Maiku fixed, fixes #2359
Ka-Hing Cheung <khc@hxbc.us>
parents: 21791
diff changeset
107 } else {
23543
80d09f42b157 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23526
diff changeset
108 purple_prpl_got_user_status(account, user->passport, "offline", NULL);
22553
1168dc635ac1 some other mobile stuff that Maiku fixed, fixes #2359
Ka-Hing Cheung <khc@hxbc.us>
parents: 21791
diff changeset
109 }
23543
80d09f42b157 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23526
diff changeset
110 }
22553
1168dc635ac1 some other mobile stuff that Maiku fixed, fixes #2359
Ka-Hing Cheung <khc@hxbc.us>
parents: 21791
diff changeset
111
23543
80d09f42b157 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23526
diff changeset
112 if (!offline || !user->mobile) {
80d09f42b157 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23526
diff changeset
113 purple_prpl_got_user_status_deactive(account, user->passport, "mobile");
80d09f42b157 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23526
diff changeset
114 }
20570
5913725cbcd6 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20514
diff changeset
115
29350
99d1b433dba0 Keep CurrentMedia in a separate object outside of MsnUser that needs to
Mark Doliner <mark@kingant.net>
parents: 28738
diff changeset
116 if (!offline && user->media && user->media->type != CURRENT_MEDIA_UNKNOWN) {
99d1b433dba0 Keep CurrentMedia in a separate object outside of MsnUser that needs to
Mark Doliner <mark@kingant.net>
parents: 28738
diff changeset
117 if (user->media->type == CURRENT_MEDIA_MUSIC) {
24455
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23876
diff changeset
118 purple_prpl_got_user_status(account, user->passport, "tune",
29350
99d1b433dba0 Keep CurrentMedia in a separate object outside of MsnUser that needs to
Mark Doliner <mark@kingant.net>
parents: 28738
diff changeset
119 PURPLE_TUNE_ARTIST, user->media->artist,
99d1b433dba0 Keep CurrentMedia in a separate object outside of MsnUser that needs to
Mark Doliner <mark@kingant.net>
parents: 28738
diff changeset
120 PURPLE_TUNE_ALBUM, user->media->album,
99d1b433dba0 Keep CurrentMedia in a separate object outside of MsnUser that needs to
Mark Doliner <mark@kingant.net>
parents: 28738
diff changeset
121 PURPLE_TUNE_TITLE, user->media->title,
24455
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23876
diff changeset
122 NULL);
29350
99d1b433dba0 Keep CurrentMedia in a separate object outside of MsnUser that needs to
Mark Doliner <mark@kingant.net>
parents: 28738
diff changeset
123 } else if (user->media->type == CURRENT_MEDIA_GAMES) {
24455
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23876
diff changeset
124 purple_prpl_got_user_status(account, user->passport, "tune",
29350
99d1b433dba0 Keep CurrentMedia in a separate object outside of MsnUser that needs to
Mark Doliner <mark@kingant.net>
parents: 28738
diff changeset
125 "game", user->media->title,
24455
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23876
diff changeset
126 NULL);
29350
99d1b433dba0 Keep CurrentMedia in a separate object outside of MsnUser that needs to
Mark Doliner <mark@kingant.net>
parents: 28738
diff changeset
127 } else if (user->media->type == CURRENT_MEDIA_OFFICE) {
24455
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23876
diff changeset
128 purple_prpl_got_user_status(account, user->passport, "tune",
29350
99d1b433dba0 Keep CurrentMedia in a separate object outside of MsnUser that needs to
Mark Doliner <mark@kingant.net>
parents: 28738
diff changeset
129 "office", user->media->title,
24455
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23876
diff changeset
130 NULL);
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23876
diff changeset
131 } else {
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23876
diff changeset
132 purple_debug_warning("msn", "Got CurrentMedia with unknown type %d.\n",
29350
99d1b433dba0 Keep CurrentMedia in a separate object outside of MsnUser that needs to
Mark Doliner <mark@kingant.net>
parents: 28738
diff changeset
133 user->media->type);
24455
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23876
diff changeset
134 }
23543
80d09f42b157 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23526
diff changeset
135 } else {
80d09f42b157 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23526
diff changeset
136 purple_prpl_got_user_status_deactive(account, user->passport, "tune");
15541
d74985add99f 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@gmail.com>
parents: 15374
diff changeset
137 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
138
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
139 if (user->idle)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15541
diff changeset
140 purple_prpl_got_user_idle(account, user->passport, TRUE, -1);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
141 else
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15541
diff changeset
142 purple_prpl_got_user_idle(account, user->passport, FALSE, 0);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
143 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
144
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
145 void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
146 msn_user_set_state(MsnUser *user, const char *state)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
147 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
148 const char *status;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
149
23876
169c1451b7e5 Don't crash if user == NULL in a couple more places. Not exactly the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23602
diff changeset
150 g_return_if_fail(user != NULL);
169c1451b7e5 Don't crash if user == NULL in a couple more places. Not exactly the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23602
diff changeset
151
23543
80d09f42b157 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23526
diff changeset
152 if (state == NULL) {
80d09f42b157 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23526
diff changeset
153 user->status = NULL;
80d09f42b157 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23526
diff changeset
154 return;
80d09f42b157 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23526
diff changeset
155 }
80d09f42b157 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23526
diff changeset
156
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
157 if (!g_ascii_strcasecmp(state, "BSY"))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
158 status = "busy";
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
159 else if (!g_ascii_strcasecmp(state, "BRB"))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
160 status = "brb";
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
161 else if (!g_ascii_strcasecmp(state, "AWY"))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
162 status = "away";
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
163 else if (!g_ascii_strcasecmp(state, "PHN"))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
164 status = "phone";
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
165 else if (!g_ascii_strcasecmp(state, "LUN"))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
166 status = "lunch";
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
167 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
168 status = "available";
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
169
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
170 if (!g_ascii_strcasecmp(state, "IDL"))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
171 user->idle = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
172 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
173 user->idle = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
174
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
175 user->status = status;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
176 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
177
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
178 void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
179 msn_user_set_passport(MsnUser *user, const char *passport)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
180 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
181 g_return_if_fail(user != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
182
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
183 g_free(user->passport);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
184 user->passport = g_strdup(passport);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
185 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
186
25033
f5188d4d84e3 Move the check for whether to update the server alias out of nln_cmd and
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24463
diff changeset
187 gboolean
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
188 msn_user_set_friendly_name(MsnUser *user, const char *name)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
189 {
25051
cd7aa76faef6 Fix this compile warning:
Mark Doliner <mark@kingant.net>
parents: 25033
diff changeset
190 g_return_val_if_fail(user != NULL, FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
191
28738
d213c8ad89da Fix MSN forgetting display names for buddies. Fixes #10421.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26991
diff changeset
192 if (user->friendly_name && name && (!strcmp(user->friendly_name, name) ||
d213c8ad89da Fix MSN forgetting display names for buddies. Fixes #10421.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26991
diff changeset
193 !strcmp(user->passport, name)))
25033
f5188d4d84e3 Move the check for whether to update the server alias out of nln_cmd and
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24463
diff changeset
194 return FALSE;
f5188d4d84e3 Move the check for whether to update the server alias out of nln_cmd and
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24463
diff changeset
195
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
196 g_free(user->friendly_name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
197 user->friendly_name = g_strdup(name);
25033
f5188d4d84e3 Move the check for whether to update the server alias out of nln_cmd and
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24463
diff changeset
198
28738
d213c8ad89da Fix MSN forgetting display names for buddies. Fixes #10421.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26991
diff changeset
199 serv_got_alias(purple_account_get_connection(user->userlist->session->account),
d213c8ad89da Fix MSN forgetting display names for buddies. Fixes #10421.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26991
diff changeset
200 user->passport, name);
25033
f5188d4d84e3 Move the check for whether to update the server alias out of nln_cmd and
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24463
diff changeset
201 return TRUE;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
202 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
203
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
204 void
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
205 msn_user_set_statusline(MsnUser *user, const char *statusline)
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
206 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
207 g_return_if_fail(user != NULL);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
208
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
209 g_free(user->statusline);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
210 user->statusline = g_strdup(statusline);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
211 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
212
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
213 void
29350
99d1b433dba0 Keep CurrentMedia in a separate object outside of MsnUser that needs to
Mark Doliner <mark@kingant.net>
parents: 28738
diff changeset
214 msn_user_set_currentmedia(MsnUser *user, CurrentMedia *media)
19797
60bc06498746 Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents: 15823
diff changeset
215 {
29350
99d1b433dba0 Keep CurrentMedia in a separate object outside of MsnUser that needs to
Mark Doliner <mark@kingant.net>
parents: 28738
diff changeset
216 if (user->media) {
99d1b433dba0 Keep CurrentMedia in a separate object outside of MsnUser that needs to
Mark Doliner <mark@kingant.net>
parents: 28738
diff changeset
217 g_free(user->media->title);
99d1b433dba0 Keep CurrentMedia in a separate object outside of MsnUser that needs to
Mark Doliner <mark@kingant.net>
parents: 28738
diff changeset
218 g_free(user->media->album);
99d1b433dba0 Keep CurrentMedia in a separate object outside of MsnUser that needs to
Mark Doliner <mark@kingant.net>
parents: 28738
diff changeset
219 g_free(user->media->artist);
99d1b433dba0 Keep CurrentMedia in a separate object outside of MsnUser that needs to
Mark Doliner <mark@kingant.net>
parents: 28738
diff changeset
220 g_free(user->media);
99d1b433dba0 Keep CurrentMedia in a separate object outside of MsnUser that needs to
Mark Doliner <mark@kingant.net>
parents: 28738
diff changeset
221 }
19797
60bc06498746 Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents: 15823
diff changeset
222
29350
99d1b433dba0 Keep CurrentMedia in a separate object outside of MsnUser that needs to
Mark Doliner <mark@kingant.net>
parents: 28738
diff changeset
223 user->media = media;
19797
60bc06498746 Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents: 15823
diff changeset
224 }
60bc06498746 Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents: 15823
diff changeset
225
60bc06498746 Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents: 15823
diff changeset
226 void
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
227 msn_user_set_uid(MsnUser *user, const char *uid)
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
228 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
229 g_return_if_fail(user != NULL);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
230
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
231 g_free(user->uid);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
232 user->uid = g_strdup(uid);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
233 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
234
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
235 void
20425
5048651671e1 Revert a bunch of whitespace changes so reviewing a diff against
Stu Tomlinson <stu@nosnilmot.com>
parents: 20411
diff changeset
236 msn_user_set_op(MsnUser *user, int list_op)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
237 {
20425
5048651671e1 Revert a bunch of whitespace changes so reviewing a diff against
Stu Tomlinson <stu@nosnilmot.com>
parents: 20411
diff changeset
238 g_return_if_fail(user != NULL);
5048651671e1 Revert a bunch of whitespace changes so reviewing a diff against
Stu Tomlinson <stu@nosnilmot.com>
parents: 20411
diff changeset
239
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
240 user->list_op |= list_op;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
241 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
242
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
243 void
20486
ff4ae9dde291 Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20481
diff changeset
244 msn_user_unset_op(MsnUser *user, int list_op)
ff4ae9dde291 Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20481
diff changeset
245 {
ff4ae9dde291 Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20481
diff changeset
246 g_return_if_fail(user != NULL);
23300
5cdd93dac7a2 Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 23124
diff changeset
247
20486
ff4ae9dde291 Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20481
diff changeset
248 user->list_op &= ~list_op;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
249 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
250
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
251 void
16390
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
252 msn_user_set_buddy_icon(MsnUser *user, PurpleStoredImage *img)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
253 {
22887
b65997110933 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 <imadil@gmail.com>
parents: 21791
diff changeset
254 MsnObject *msnobj;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
255
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
256 g_return_if_fail(user != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
257
22887
b65997110933 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 <imadil@gmail.com>
parents: 21791
diff changeset
258 msnobj = msn_object_new_from_image(img, "TFR2C2.tmp",
b65997110933 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 <imadil@gmail.com>
parents: 21791
diff changeset
259 user->passport, MSN_OBJECT_USERTILE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
260
22887
b65997110933 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 <imadil@gmail.com>
parents: 21791
diff changeset
261 if (!msnobj)
b65997110933 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 <imadil@gmail.com>
parents: 21791
diff changeset
262 purple_debug_error("msn", "Unable to open buddy icon from %s!\n", user->passport);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
263
22887
b65997110933 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 <imadil@gmail.com>
parents: 21791
diff changeset
264 msn_user_set_object(user, msnobj);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
265 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
266
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
267 /*add group id to User object*/
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
268 void
23602
aaaff38e144f Fix a double free when connecting to the sender of a bonjour file fails. Also plug a small leak. Fixes #5971.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23564
diff changeset
269 msn_user_add_group_id(MsnUser *user, const char* group_id)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
270 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
271 MsnUserList *userlist;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15541
diff changeset
272 PurpleAccount *account;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15541
diff changeset
273 PurpleBuddy *b;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15541
diff changeset
274 PurpleGroup *g;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
275 const char *passport;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
276 const char *group_name;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
277
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
278 g_return_if_fail(user != NULL);
23602
aaaff38e144f Fix a double free when connecting to the sender of a bonjour file fails. Also plug a small leak. Fixes #5971.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23564
diff changeset
279 g_return_if_fail(group_id != NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
280
23602
aaaff38e144f Fix a double free when connecting to the sender of a bonjour file fails. Also plug a small leak. Fixes #5971.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23564
diff changeset
281 user->group_ids = g_list_append(user->group_ids, g_strdup(group_id));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
282
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
283 userlist = user->userlist;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
284 account = userlist->session->account;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
285 passport = msn_user_get_passport(user);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
286
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
287 group_name = msn_userlist_find_group_name(userlist, group_id);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
288
23564
7bceac816e19 The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23543
diff changeset
289 purple_debug_info("msn", "User: group id:%s,name:%s,user:%s\n", group_id, group_name, passport);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
290
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15541
diff changeset
291 g = purple_find_group(group_name);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
292
23602
aaaff38e144f Fix a double free when connecting to the sender of a bonjour file fails. Also plug a small leak. Fixes #5971.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23564
diff changeset
293 if ((group_id == NULL) && (g == NULL))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
294 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15541
diff changeset
295 g = purple_group_new(group_name);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15541
diff changeset
296 purple_blist_add_group(g, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
297 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
298
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15541
diff changeset
299 b = purple_find_buddy_in_group(account, passport, g);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
300 if (b == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
301 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15541
diff changeset
302 b = purple_buddy_new(account, passport, NULL);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15541
diff changeset
303 purple_blist_add_buddy(b, NULL, g, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
304 }
25290
8d562557ed6f Some more PurpleBuddy::proto_data related changes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23876
diff changeset
305 purple_buddy_set_protocol_data(b, user);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
306 /*Update the blist Node info*/
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
307 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
308
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
309 /*check if the msn user is online*/
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
310 gboolean
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
311 msn_user_is_online(PurpleAccount *account, const char *name)
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
312 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
313 PurpleBuddy *buddy;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
314
23876
169c1451b7e5 Don't crash if user == NULL in a couple more places. Not exactly the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23602
diff changeset
315 buddy = purple_find_buddy(account, name);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
316 return PURPLE_BUDDY_IS_ONLINE(buddy);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
317 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
318
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
319 gboolean
20436
ad481ea028be Fix msn_user_remove_group_id()
Stu Tomlinson <stu@nosnilmot.com>
parents: 20425
diff changeset
320 msn_user_is_yahoo(PurpleAccount *account, const char *name)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
321 {
20447
18ecdee88ed0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents: 20445
diff changeset
322 MsnSession *session = NULL;
18ecdee88ed0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents: 20445
diff changeset
323 MsnUser *user;
18ecdee88ed0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents: 20445
diff changeset
324 PurpleConnection *gc;
18ecdee88ed0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents: 20445
diff changeset
325
18ecdee88ed0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents: 20445
diff changeset
326 gc = purple_account_get_connection(account);
18ecdee88ed0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents: 20445
diff changeset
327 if (gc != NULL)
18ecdee88ed0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents: 20445
diff changeset
328 session = gc->proto_data;
18ecdee88ed0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents: 20445
diff changeset
329
18ecdee88ed0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents: 20445
diff changeset
330 if ((session != NULL) && (user = msn_userlist_find_user(session->userlist, name)) != NULL)
18ecdee88ed0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents: 20445
diff changeset
331 {
23523
31b5a1334e7e Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23516
diff changeset
332 return (user->networkid == MSN_NETWORK_YAHOO);
20447
18ecdee88ed0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents: 20445
diff changeset
333 }
18ecdee88ed0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents: 20445
diff changeset
334 return (strstr(name,"@yahoo.") != NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
335 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
336
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
337 void
20436
ad481ea028be Fix msn_user_remove_group_id()
Stu Tomlinson <stu@nosnilmot.com>
parents: 20425
diff changeset
338 msn_user_remove_group_id(MsnUser *user, const char *id)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
339 {
20436
ad481ea028be Fix msn_user_remove_group_id()
Stu Tomlinson <stu@nosnilmot.com>
parents: 20425
diff changeset
340 GList *l;
ad481ea028be Fix msn_user_remove_group_id()
Stu Tomlinson <stu@nosnilmot.com>
parents: 20425
diff changeset
341
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
342 g_return_if_fail(user != NULL);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
343 g_return_if_fail(id != NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
344
20436
ad481ea028be Fix msn_user_remove_group_id()
Stu Tomlinson <stu@nosnilmot.com>
parents: 20425
diff changeset
345 l = g_list_find_custom(user->group_ids, id, (GCompareFunc)strcmp);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
346
20436
ad481ea028be Fix msn_user_remove_group_id()
Stu Tomlinson <stu@nosnilmot.com>
parents: 20425
diff changeset
347 if (l == NULL)
ad481ea028be Fix msn_user_remove_group_id()
Stu Tomlinson <stu@nosnilmot.com>
parents: 20425
diff changeset
348 return;
ad481ea028be Fix msn_user_remove_group_id()
Stu Tomlinson <stu@nosnilmot.com>
parents: 20425
diff changeset
349
ad481ea028be Fix msn_user_remove_group_id()
Stu Tomlinson <stu@nosnilmot.com>
parents: 20425
diff changeset
350 g_free(l->data);
20987
0cbfc19e4909 Fix some leaks caused by misuse of g_list_remove_link() instead of g_list_delete_link().
Daniel Atallah <daniel.atallah@gmail.com>
parents: 20942
diff changeset
351 user->group_ids = g_list_delete_link(user->group_ids, l);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
352 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
353
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
354 void
24463
4fd22591e3f0 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24455
diff changeset
355 msn_user_set_pending_group(MsnUser *user, const char *group)
4fd22591e3f0 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24455
diff changeset
356 {
4fd22591e3f0 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24455
diff changeset
357 user->pending_group = g_strdup(group);
4fd22591e3f0 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24455
diff changeset
358 }
4fd22591e3f0 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24455
diff changeset
359
4fd22591e3f0 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24455
diff changeset
360 char *
4fd22591e3f0 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24455
diff changeset
361 msn_user_remove_pending_group(MsnUser *user)
4fd22591e3f0 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24455
diff changeset
362 {
4fd22591e3f0 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24455
diff changeset
363 char *group = user->pending_group;
4fd22591e3f0 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24455
diff changeset
364 user->pending_group = NULL;
4fd22591e3f0 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24455
diff changeset
365 return group;
4fd22591e3f0 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24455
diff changeset
366 }
4fd22591e3f0 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24455
diff changeset
367
4fd22591e3f0 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24455
diff changeset
368 void
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
369 msn_user_set_home_phone(MsnUser *user, const char *number)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
370 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
371 g_return_if_fail(user != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
372
29351
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
373 if (!number && !user->phone)
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
374 return;
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
375
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
376 if (user->phone)
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
377 g_free(user->phone->home);
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
378 else
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
379 user->phone = g_new0(MsnUserPhoneInfo, 1);
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
380
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
381 user->phone->home = g_strdup(number);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
382 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
383
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
384 void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
385 msn_user_set_work_phone(MsnUser *user, const char *number)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
386 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
387 g_return_if_fail(user != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
388
29351
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
389 if (!number && !user->phone)
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
390 return;
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
391
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
392 if (user->phone)
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
393 g_free(user->phone->work);
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
394 else
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
395 user->phone = g_new0(MsnUserPhoneInfo, 1);
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
396
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
397 user->phone->work = g_strdup(number);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
398 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
399
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
400 void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
401 msn_user_set_mobile_phone(MsnUser *user, const char *number)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
402 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
403 g_return_if_fail(user != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
404
29351
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
405 if (!number && !user->phone)
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
406 return;
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
407
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
408 if (user->phone)
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
409 g_free(user->phone->mobile);
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
410 else
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
411 user->phone = g_new0(MsnUserPhoneInfo, 1);
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
412
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
413 user->phone->mobile = g_strdup(number);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
414 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
415
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
416 void
23523
31b5a1334e7e Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23516
diff changeset
417 msn_user_set_clientid(MsnUser *user, guint clientid)
31b5a1334e7e Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23516
diff changeset
418 {
31b5a1334e7e Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23516
diff changeset
419 g_return_if_fail(user != NULL);
31b5a1334e7e Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23516
diff changeset
420
31b5a1334e7e Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23516
diff changeset
421 user->clientid = clientid;
31b5a1334e7e Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23516
diff changeset
422 }
31b5a1334e7e Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23516
diff changeset
423
31b5a1334e7e Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23516
diff changeset
424 void
31b5a1334e7e Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23516
diff changeset
425 msn_user_set_network(MsnUser *user, MsnNetwork network)
31b5a1334e7e Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23516
diff changeset
426 {
31b5a1334e7e Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23516
diff changeset
427 g_return_if_fail(user != NULL);
31b5a1334e7e Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23516
diff changeset
428
31b5a1334e7e Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23516
diff changeset
429 user->networkid = network;
31b5a1334e7e Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23516
diff changeset
430 }
31b5a1334e7e Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23516
diff changeset
431
31b5a1334e7e Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23516
diff changeset
432 void
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
433 msn_user_set_object(MsnUser *user, MsnObject *obj)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
434 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
435 g_return_if_fail(user != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
436
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
437 if (user->msnobj != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
438 msn_object_destroy(user->msnobj);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
439
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
440 user->msnobj = obj;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
441
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
442 if (user->list_op & MSN_LIST_FL_OP)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
443 msn_queue_buddy_icon_request(user);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
444 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
445
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
446 void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
447 msn_user_set_client_caps(MsnUser *user, GHashTable *info)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
448 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
449 g_return_if_fail(user != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
450 g_return_if_fail(info != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
451
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
452 if (user->clientcaps != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
453 g_hash_table_destroy(user->clientcaps);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
454
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
455 user->clientcaps = info;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
456 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
457
26991
2a95e8bd9b80 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25438
diff changeset
458 void
2a95e8bd9b80 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25438
diff changeset
459 msn_user_set_invite_message(MsnUser *user, const char *message)
2a95e8bd9b80 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25438
diff changeset
460 {
2a95e8bd9b80 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25438
diff changeset
461 g_return_if_fail(user != NULL);
2a95e8bd9b80 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25438
diff changeset
462
2a95e8bd9b80 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25438
diff changeset
463 g_free(user->invite_message);
2a95e8bd9b80 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25438
diff changeset
464 user->invite_message = g_strdup(message);
2a95e8bd9b80 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25438
diff changeset
465 }
2a95e8bd9b80 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25438
diff changeset
466
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
467 const char *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
468 msn_user_get_passport(const MsnUser *user)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
469 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
470 g_return_val_if_fail(user != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
471
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
472 return user->passport;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
473 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
474
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
475 const char *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
476 msn_user_get_friendly_name(const MsnUser *user)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
477 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
478 g_return_val_if_fail(user != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
479
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
480 return user->friendly_name;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
481 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
482
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
483 const char *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
484 msn_user_get_home_phone(const MsnUser *user)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
485 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
486 g_return_val_if_fail(user != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
487
29351
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
488 return user->phone ? user->phone->home : NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
489 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
490
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
491 const char *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
492 msn_user_get_work_phone(const MsnUser *user)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
493 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
494 g_return_val_if_fail(user != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
495
29351
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
496 return user->phone ? user->phone->work : NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
497 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
498
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
499 const char *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
500 msn_user_get_mobile_phone(const MsnUser *user)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
501 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
502 g_return_val_if_fail(user != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
503
29351
08296b862f98 Move the three phone numbers from the MsnUser struct into a separate
Mark Doliner <mark@kingant.net>
parents: 29350
diff changeset
504 return user->phone ? user->phone->mobile : NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
505 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
506
23523
31b5a1334e7e Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23516
diff changeset
507 guint
31b5a1334e7e Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23516
diff changeset
508 msn_user_get_clientid(const MsnUser *user)
31b5a1334e7e Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23516
diff changeset
509 {
31b5a1334e7e Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23516
diff changeset
510 g_return_val_if_fail(user != NULL, 0);
31b5a1334e7e Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23516
diff changeset
511
31b5a1334e7e Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23516
diff changeset
512 return user->clientid;
31b5a1334e7e Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23516
diff changeset
513 }
31b5a1334e7e Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23516
diff changeset
514
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
515 MsnObject *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
516 msn_user_get_object(const MsnUser *user)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
517 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
518 g_return_val_if_fail(user != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
519
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
520 return user->msnobj;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
521 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
522
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
523 GHashTable *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
524 msn_user_get_client_caps(const MsnUser *user)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
525 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
526 g_return_val_if_fail(user != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
527
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
528 return user->clientcaps;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
529 }
26991
2a95e8bd9b80 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25438
diff changeset
530
2a95e8bd9b80 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25438
diff changeset
531 const char *
2a95e8bd9b80 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25438
diff changeset
532 msn_user_get_invite_message(const MsnUser *user)
2a95e8bd9b80 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25438
diff changeset
533 {
2a95e8bd9b80 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25438
diff changeset
534 g_return_val_if_fail(user != NULL, NULL);
2a95e8bd9b80 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25438
diff changeset
535
2a95e8bd9b80 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25438
diff changeset
536 return user->invite_message;
2a95e8bd9b80 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25438
diff changeset
537 }
2a95e8bd9b80 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25438
diff changeset
538