Mercurial > pidgin.yaz
annotate libpurple/protocols/yahoo/yahoo_friend.c @ 26247:74bb0836f164
msn interoperability : presence settings
author | Sulabh Mahajan <sulabh@soc.pidgin.im> |
---|---|
date | Wed, 21 Jan 2009 09:14:01 +0000 |
parents | 3b19ea3c8165 |
children | bc31ebd391d3 |
rev | line source |
---|---|
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1 /* |
15823 | 2 * purple |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3 * |
15823 | 4 * 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
|
5 * 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
|
6 * source distribution. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8 * This program is free software; you can redistribute it and/or modify |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
9 * it under the terms of the GNU General Public License as published by |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
10 * the Free Software Foundation; either version 2 of the License, or |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
11 * (at your option) any later version. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
12 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
13 * This program is distributed in the hope that it will be useful, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
16 * GNU General Public License for more details. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
17 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
18 * You should have received a copy of the GNU General Public License |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
19 * along with this program; if not, write to the Free Software |
19680
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19348
diff
changeset
|
20 * 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
|
21 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
22 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
23 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
24 #include "internal.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
25 #include "prpl.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
26 #include "util.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
27 #include "debug.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
28 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
29 #include "yahoo_friend.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
30 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
31 static YahooFriend *yahoo_friend_new(void) |
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 YahooFriend *ret; |
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 ret = g_new0(YahooFriend, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
36 ret->status = YAHOO_STATUS_OFFLINE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
37 ret->presence = YAHOO_PRESENCE_DEFAULT; |
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 return ret; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
40 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
41 |
15823 | 42 YahooFriend *yahoo_friend_find(PurpleConnection *gc, const char *name) |
15374
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 struct yahoo_data *yd; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
45 const char *norm; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
46 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
47 g_return_val_if_fail(gc != NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
48 g_return_val_if_fail(gc->proto_data != NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
49 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
50 yd = gc->proto_data; |
15823 | 51 norm = purple_normalize(purple_connection_get_account(gc), name); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
52 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
53 return g_hash_table_lookup(yd->friends, norm); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
54 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
55 |
15823 | 56 YahooFriend *yahoo_friend_find_or_new(PurpleConnection *gc, const char *name) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
57 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
58 YahooFriend *f; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
59 struct yahoo_data *yd; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
60 const char *norm; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
61 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
62 g_return_val_if_fail(gc != NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
63 g_return_val_if_fail(gc->proto_data != NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
64 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
65 yd = gc->proto_data; |
15823 | 66 norm = purple_normalize(purple_connection_get_account(gc), name); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
67 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
68 f = g_hash_table_lookup(yd->friends, norm); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
69 if (!f) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
70 f = yahoo_friend_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
71 g_hash_table_insert(yd->friends, g_strdup(norm), f); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
72 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
73 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
74 return f; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
75 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
76 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
77 void yahoo_friend_set_ip(YahooFriend *f, const char *ip) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
78 { |
22807
0b11895cc564
Leak fixes. Avoid creating an unnecessary parallel data structure to YahooFriend.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19680
diff
changeset
|
79 g_free(f->ip); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
80 f->ip = g_strdup(ip); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
81 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
82 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
83 const char *yahoo_friend_get_ip(YahooFriend *f) |
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 return f->ip; |
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 yahoo_friend_set_game(YahooFriend *f, const char *game) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
89 { |
22807
0b11895cc564
Leak fixes. Avoid creating an unnecessary parallel data structure to YahooFriend.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19680
diff
changeset
|
90 g_free(f->game); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
91 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
92 if (game) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
93 f->game = g_strdup(game); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
94 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
95 f->game = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
96 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
97 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
98 const char *yahoo_friend_get_game(YahooFriend *f) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
99 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
100 return f->game; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
101 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
102 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
103 void yahoo_friend_set_status_message(YahooFriend *f, char *msg) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
104 { |
22807
0b11895cc564
Leak fixes. Avoid creating an unnecessary parallel data structure to YahooFriend.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19680
diff
changeset
|
105 g_free(f->msg); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
106 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
107 f->msg = msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
108 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
109 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
110 const char *yahoo_friend_get_status_message(YahooFriend *f) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
111 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
112 return f->msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
113 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
114 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
115 void yahoo_friend_set_buddy_icon_need_request(YahooFriend *f, gboolean needs) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
116 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
117 f->bicon_sent_request = !needs; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
118 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
119 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
120 gboolean yahoo_friend_get_buddy_icon_need_request(YahooFriend *f) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
121 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
122 return !f->bicon_sent_request; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
123 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
124 |
22807
0b11895cc564
Leak fixes. Avoid creating an unnecessary parallel data structure to YahooFriend.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19680
diff
changeset
|
125 void yahoo_friend_set_alias_id(YahooFriend *f, const char *alias_id) |
0b11895cc564
Leak fixes. Avoid creating an unnecessary parallel data structure to YahooFriend.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19680
diff
changeset
|
126 { |
0b11895cc564
Leak fixes. Avoid creating an unnecessary parallel data structure to YahooFriend.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19680
diff
changeset
|
127 g_free(f->alias_id); |
0b11895cc564
Leak fixes. Avoid creating an unnecessary parallel data structure to YahooFriend.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19680
diff
changeset
|
128 f->alias_id = g_strdup(alias_id); |
0b11895cc564
Leak fixes. Avoid creating an unnecessary parallel data structure to YahooFriend.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19680
diff
changeset
|
129 } |
0b11895cc564
Leak fixes. Avoid creating an unnecessary parallel data structure to YahooFriend.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19680
diff
changeset
|
130 |
0b11895cc564
Leak fixes. Avoid creating an unnecessary parallel data structure to YahooFriend.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19680
diff
changeset
|
131 const char *yahoo_friend_get_alias_id(YahooFriend *f) |
0b11895cc564
Leak fixes. Avoid creating an unnecessary parallel data structure to YahooFriend.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19680
diff
changeset
|
132 { |
0b11895cc564
Leak fixes. Avoid creating an unnecessary parallel data structure to YahooFriend.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19680
diff
changeset
|
133 return f->alias_id; |
0b11895cc564
Leak fixes. Avoid creating an unnecessary parallel data structure to YahooFriend.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19680
diff
changeset
|
134 } |
0b11895cc564
Leak fixes. Avoid creating an unnecessary parallel data structure to YahooFriend.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19680
diff
changeset
|
135 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
136 void yahoo_friend_free(gpointer p) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
137 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
138 YahooFriend *f = p; |
22807
0b11895cc564
Leak fixes. Avoid creating an unnecessary parallel data structure to YahooFriend.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19680
diff
changeset
|
139 g_free(f->msg); |
0b11895cc564
Leak fixes. Avoid creating an unnecessary parallel data structure to YahooFriend.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19680
diff
changeset
|
140 g_free(f->game); |
0b11895cc564
Leak fixes. Avoid creating an unnecessary parallel data structure to YahooFriend.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19680
diff
changeset
|
141 g_free(f->ip); |
0b11895cc564
Leak fixes. Avoid creating an unnecessary parallel data structure to YahooFriend.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19680
diff
changeset
|
142 g_free(f->alias_id); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
143 g_free(f); |
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 |
15823 | 146 void yahoo_process_presence(PurpleConnection *gc, struct yahoo_packet *pkt) |
15374
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 GSList *l = pkt->hash; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
149 YahooFriend *f; |
26247
74bb0836f164
msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
26224
diff
changeset
|
150 char *temp = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
151 char *who = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
152 int value = 0; |
26247
74bb0836f164
msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
26224
diff
changeset
|
153 int protocol = 0; |
74bb0836f164
msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
26224
diff
changeset
|
154 gboolean wlm = FALSE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
155 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
156 while (l) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
157 struct yahoo_pair *pair = l->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
158 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
159 switch (pair->key) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
160 case 7: |
26247
74bb0836f164
msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
26224
diff
changeset
|
161 temp = pair->value; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
162 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
163 case 31: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
164 value = strtol(pair->value, NULL, 10); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
165 break; |
26247
74bb0836f164
msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
26224
diff
changeset
|
166 case 241: |
74bb0836f164
msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
26224
diff
changeset
|
167 protocol = strtol(pair->value, NULL, 10); |
74bb0836f164
msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
26224
diff
changeset
|
168 wlm = TRUE; |
74bb0836f164
msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
26224
diff
changeset
|
169 break; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
170 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
171 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
172 l = l->next; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
173 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
174 |
26247
74bb0836f164
msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
26224
diff
changeset
|
175 if(wlm) |
74bb0836f164
msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
26224
diff
changeset
|
176 who = g_strconcat("wlm/", temp, NULL); |
74bb0836f164
msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
26224
diff
changeset
|
177 else |
74bb0836f164
msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
26224
diff
changeset
|
178 who = g_strdup(temp); |
74bb0836f164
msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
26224
diff
changeset
|
179 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
180 if (value != 1 && value != 2) { |
15823 | 181 purple_debug_error("yahoo", "Received unknown value for presence key: %d\n", value); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
182 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
183 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
184 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
185 g_return_if_fail(who != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
186 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
187 f = yahoo_friend_find(gc, who); |
26247
74bb0836f164
msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
26224
diff
changeset
|
188 if (!f) { |
74bb0836f164
msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
26224
diff
changeset
|
189 g_free(who); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
190 return; |
26247
74bb0836f164
msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
26224
diff
changeset
|
191 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
192 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
193 if (pkt->service == YAHOO_SERVICE_PRESENCE_PERM) { |
15823 | 194 purple_debug_info("yahoo", "Setting permanent presence for %s to %d.\n", who, (value == 1)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
195 /* If setting from perm offline to online when in invisible status, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
196 * this has already been taken care of (when the temp status changed) */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
197 if (value == 2 && f->presence == YAHOO_PRESENCE_ONLINE) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
198 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
199 if (value == 1) /* Setting Perm offline */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
200 f->presence = YAHOO_PRESENCE_PERM_OFFLINE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
201 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
202 f->presence = YAHOO_PRESENCE_DEFAULT; |
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 } else { |
15823 | 205 purple_debug_info("yahoo", "Setting session presence for %s to %d.\n", who, (value == 1)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
206 if (value == 1) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
207 f->presence = YAHOO_PRESENCE_ONLINE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
208 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
209 f->presence = YAHOO_PRESENCE_DEFAULT; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
210 } |
26247
74bb0836f164
msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
26224
diff
changeset
|
211 g_free(who); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
212 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
213 |
15823 | 214 void yahoo_friend_update_presence(PurpleConnection *gc, const char *name, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
215 YahooPresenceVisibility presence) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
216 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
217 struct yahoo_data *yd = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
218 struct yahoo_packet *pkt = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
219 YahooFriend *f; |
19348
f0c4b4fdbd16
Add some additional yahoo keys to the stealth packets to make them work again. Fixes #2654.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
220 const char *thirtyone, *thirteen; |
f0c4b4fdbd16
Add some additional yahoo keys to the stealth packets to make them work again. Fixes #2654.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
221 int service = -1; |
26247
74bb0836f164
msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
26224
diff
changeset
|
222 const char *temp = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
223 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
224 if (!yd->logged_in) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
225 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
226 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
227 f = yahoo_friend_find(gc, name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
228 if (!f) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
229 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
230 |
26247
74bb0836f164
msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
26224
diff
changeset
|
231 if(f->protocol == 2) |
74bb0836f164
msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
26224
diff
changeset
|
232 temp = name+4; |
74bb0836f164
msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
26224
diff
changeset
|
233 else |
74bb0836f164
msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
26224
diff
changeset
|
234 temp = name; |
74bb0836f164
msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
26224
diff
changeset
|
235 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
236 /* No need to change the value if it is already correct */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
237 if (f->presence == presence) { |
15823 | 238 purple_debug_info("yahoo", "Not setting presence because there are no changes.\n"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
239 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
240 } |
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 if (presence == YAHOO_PRESENCE_PERM_OFFLINE) { |
19348
f0c4b4fdbd16
Add some additional yahoo keys to the stealth packets to make them work again. Fixes #2654.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
243 service = YAHOO_SERVICE_PRESENCE_PERM; |
f0c4b4fdbd16
Add some additional yahoo keys to the stealth packets to make them work again. Fixes #2654.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
244 thirtyone = "1"; |
f0c4b4fdbd16
Add some additional yahoo keys to the stealth packets to make them work again. Fixes #2654.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
245 thirteen = "2"; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
246 } else if (presence == YAHOO_PRESENCE_DEFAULT) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
247 if (f->presence == YAHOO_PRESENCE_PERM_OFFLINE) { |
19348
f0c4b4fdbd16
Add some additional yahoo keys to the stealth packets to make them work again. Fixes #2654.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
248 service = YAHOO_SERVICE_PRESENCE_PERM; |
f0c4b4fdbd16
Add some additional yahoo keys to the stealth packets to make them work again. Fixes #2654.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
249 thirtyone = "2"; |
f0c4b4fdbd16
Add some additional yahoo keys to the stealth packets to make them work again. Fixes #2654.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
250 thirteen = "2"; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
251 } else if (yd->current_status == YAHOO_STATUS_INVISIBLE) { |
19348
f0c4b4fdbd16
Add some additional yahoo keys to the stealth packets to make them work again. Fixes #2654.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
252 service = YAHOO_SERVICE_PRESENCE_SESSION; |
f0c4b4fdbd16
Add some additional yahoo keys to the stealth packets to make them work again. Fixes #2654.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
253 thirtyone = "2"; |
f0c4b4fdbd16
Add some additional yahoo keys to the stealth packets to make them work again. Fixes #2654.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
254 thirteen = "1"; |
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 } else if (presence == YAHOO_PRESENCE_ONLINE) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
257 if (f->presence == YAHOO_PRESENCE_PERM_OFFLINE) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
258 pkt = yahoo_packet_new(YAHOO_SERVICE_PRESENCE_PERM, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
259 YAHOO_STATUS_AVAILABLE, yd->session_id); |
26224
3b19ea3c8165
MSN Interoperability, add, remove buddies, change group, send im, etc
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
25625
diff
changeset
|
260 if(f->protocol) |
3b19ea3c8165
MSN Interoperability, add, remove buddies, change group, send im, etc
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
25625
diff
changeset
|
261 yahoo_packet_hash(pkt, "ssssssiss", |
3b19ea3c8165
MSN Interoperability, add, remove buddies, change group, send im, etc
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
25625
diff
changeset
|
262 1, purple_connection_get_display_name(gc), |
3b19ea3c8165
MSN Interoperability, add, remove buddies, change group, send im, etc
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
25625
diff
changeset
|
263 31, "2", 13, "2", |
3b19ea3c8165
MSN Interoperability, add, remove buddies, change group, send im, etc
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
25625
diff
changeset
|
264 302, "319", 300, "319", |
26247
74bb0836f164
msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
26224
diff
changeset
|
265 7, temp, 241, f->protocol, |
26224
3b19ea3c8165
MSN Interoperability, add, remove buddies, change group, send im, etc
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
25625
diff
changeset
|
266 301, "319", 303, "319"); |
3b19ea3c8165
MSN Interoperability, add, remove buddies, change group, send im, etc
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
25625
diff
changeset
|
267 else |
3b19ea3c8165
MSN Interoperability, add, remove buddies, change group, send im, etc
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
25625
diff
changeset
|
268 yahoo_packet_hash(pkt, "ssssssss", |
15823 | 269 1, purple_connection_get_display_name(gc), |
19348
f0c4b4fdbd16
Add some additional yahoo keys to the stealth packets to make them work again. Fixes #2654.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
270 31, "2", 13, "2", |
f0c4b4fdbd16
Add some additional yahoo keys to the stealth packets to make them work again. Fixes #2654.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
271 302, "319", 300, "319", |
26247
74bb0836f164
msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
26224
diff
changeset
|
272 7, temp, |
19348
f0c4b4fdbd16
Add some additional yahoo keys to the stealth packets to make them work again. Fixes #2654.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
273 301, "319", 303, "319"); |
26224
3b19ea3c8165
MSN Interoperability, add, remove buddies, change group, send im, etc
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
25625
diff
changeset
|
274 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
275 yahoo_packet_send_and_free(pkt, yd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
276 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
277 |
19348
f0c4b4fdbd16
Add some additional yahoo keys to the stealth packets to make them work again. Fixes #2654.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
278 service = YAHOO_SERVICE_PRESENCE_SESSION; |
f0c4b4fdbd16
Add some additional yahoo keys to the stealth packets to make them work again. Fixes #2654.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
279 thirtyone = "1"; |
f0c4b4fdbd16
Add some additional yahoo keys to the stealth packets to make them work again. Fixes #2654.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
280 thirteen = "1"; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
281 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
282 |
19348
f0c4b4fdbd16
Add some additional yahoo keys to the stealth packets to make them work again. Fixes #2654.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
283 if (service > 0) { |
f0c4b4fdbd16
Add some additional yahoo keys to the stealth packets to make them work again. Fixes #2654.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
284 pkt = yahoo_packet_new(service, |
f0c4b4fdbd16
Add some additional yahoo keys to the stealth packets to make them work again. Fixes #2654.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
285 YAHOO_STATUS_AVAILABLE, yd->session_id); |
f0c4b4fdbd16
Add some additional yahoo keys to the stealth packets to make them work again. Fixes #2654.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
286 |
26224
3b19ea3c8165
MSN Interoperability, add, remove buddies, change group, send im, etc
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
25625
diff
changeset
|
287 if(f->protocol) |
3b19ea3c8165
MSN Interoperability, add, remove buddies, change group, send im, etc
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
25625
diff
changeset
|
288 yahoo_packet_hash(pkt, "ssssssiss", |
3b19ea3c8165
MSN Interoperability, add, remove buddies, change group, send im, etc
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
25625
diff
changeset
|
289 1, purple_connection_get_display_name(gc), |
3b19ea3c8165
MSN Interoperability, add, remove buddies, change group, send im, etc
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
25625
diff
changeset
|
290 31, thirtyone, 13, thirteen, |
3b19ea3c8165
MSN Interoperability, add, remove buddies, change group, send im, etc
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
25625
diff
changeset
|
291 302, "319", 300, "319", |
26247
74bb0836f164
msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
26224
diff
changeset
|
292 7, temp, 241, f->protocol, |
26224
3b19ea3c8165
MSN Interoperability, add, remove buddies, change group, send im, etc
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
25625
diff
changeset
|
293 301, "319", 303, "319"); |
3b19ea3c8165
MSN Interoperability, add, remove buddies, change group, send im, etc
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
25625
diff
changeset
|
294 else |
3b19ea3c8165
MSN Interoperability, add, remove buddies, change group, send im, etc
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
25625
diff
changeset
|
295 yahoo_packet_hash(pkt, "ssssssss", |
19348
f0c4b4fdbd16
Add some additional yahoo keys to the stealth packets to make them work again. Fixes #2654.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
296 1, purple_connection_get_display_name(gc), |
f0c4b4fdbd16
Add some additional yahoo keys to the stealth packets to make them work again. Fixes #2654.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
297 31, thirtyone, 13, thirteen, |
f0c4b4fdbd16
Add some additional yahoo keys to the stealth packets to make them work again. Fixes #2654.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
298 302, "319", 300, "319", |
26247
74bb0836f164
msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
26224
diff
changeset
|
299 7, temp, |
19348
f0c4b4fdbd16
Add some additional yahoo keys to the stealth packets to make them work again. Fixes #2654.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
300 301, "319", 303, "319"); |
f0c4b4fdbd16
Add some additional yahoo keys to the stealth packets to make them work again. Fixes #2654.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
301 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
302 yahoo_packet_send_and_free(pkt, yd); |
19348
f0c4b4fdbd16
Add some additional yahoo keys to the stealth packets to make them work again. Fixes #2654.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
303 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
304 } |
25617
f16aba67b685
Sending of p2p packet, providing peer with our IP address to make a connection to us.
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
22807
diff
changeset
|
305 |
f16aba67b685
Sending of p2p packet, providing peer with our IP address to make a connection to us.
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
22807
diff
changeset
|
306 void yahoo_friend_set_p2p_status(YahooFriend *f, YahooP2PStatus p2p_status) |
f16aba67b685
Sending of p2p packet, providing peer with our IP address to make a connection to us.
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
22807
diff
changeset
|
307 { |
f16aba67b685
Sending of p2p packet, providing peer with our IP address to make a connection to us.
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
22807
diff
changeset
|
308 f->p2p_status = p2p_status; |
f16aba67b685
Sending of p2p packet, providing peer with our IP address to make a connection to us.
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
22807
diff
changeset
|
309 } |
f16aba67b685
Sending of p2p packet, providing peer with our IP address to make a connection to us.
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
22807
diff
changeset
|
310 |
f16aba67b685
Sending of p2p packet, providing peer with our IP address to make a connection to us.
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
22807
diff
changeset
|
311 YahooP2PStatus yahoo_friend_get_p2p_status(YahooFriend *f) |
f16aba67b685
Sending of p2p packet, providing peer with our IP address to make a connection to us.
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
22807
diff
changeset
|
312 { |
f16aba67b685
Sending of p2p packet, providing peer with our IP address to make a connection to us.
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
22807
diff
changeset
|
313 return f->p2p_status; |
f16aba67b685
Sending of p2p packet, providing peer with our IP address to make a connection to us.
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents:
22807
diff
changeset
|
314 } |