annotate libpurple/protocols/yahoo/yahoo_friend.c @ 32145:3f9b670cba14

Fix searching in conversation windows.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Fri, 09 Sep 2011 07:00:03 +0000
parents fcf841ffd620
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1 /*
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
2 * purple
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3 *
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
4 * Purple is the legal property of its developers, whose names are too numerous
15373
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
19681
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
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
21 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
22 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
23
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"
27538
fa827f6f990f Add support for receiving contact details from buddies.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 27165
diff changeset
30 #include "yahoo_aliases.h"
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
31
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
32 static YahooFriend *yahoo_friend_new(void)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
33 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
34 YahooFriend *ret;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
35
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
36 ret = g_new0(YahooFriend, 1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
37 ret->status = YAHOO_STATUS_OFFLINE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
38 ret->presence = YAHOO_PRESENCE_DEFAULT;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
39
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
40 return ret;
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
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
43 YahooFriend *yahoo_friend_find(PurpleConnection *gc, const char *name)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
44 {
27694
908be3822215 Move from "struct yahoo_data" to "YahooData" to be consistent with other structs
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27538
diff changeset
45 YahooData *yd;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
46 const char *norm;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
47
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
48 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
49
31998
fcf841ffd620 Convert yahoo prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data()
andrew.victor@mxit.com
parents: 31086
diff changeset
50 yd = purple_connection_get_protocol_data(gc);
fcf841ffd620 Convert yahoo prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data()
andrew.victor@mxit.com
parents: 31086
diff changeset
51 g_return_val_if_fail(yd != NULL, NULL);
fcf841ffd620 Convert yahoo prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data()
andrew.victor@mxit.com
parents: 31086
diff changeset
52
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
53 norm = purple_normalize(purple_connection_get_account(gc), name);
15373
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 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
56 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
57
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
58 YahooFriend *yahoo_friend_find_or_new(PurpleConnection *gc, const char *name)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
59 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
60 YahooFriend *f;
27694
908be3822215 Move from "struct yahoo_data" to "YahooData" to be consistent with other structs
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27538
diff changeset
61 YahooData *yd;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
62 const char *norm;
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 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
65
31998
fcf841ffd620 Convert yahoo prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data()
andrew.victor@mxit.com
parents: 31086
diff changeset
66 yd = purple_connection_get_protocol_data(gc);
fcf841ffd620 Convert yahoo prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data()
andrew.victor@mxit.com
parents: 31086
diff changeset
67 g_return_val_if_fail(yd != NULL, NULL);
fcf841ffd620 Convert yahoo prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data()
andrew.victor@mxit.com
parents: 31086
diff changeset
68
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
69 norm = purple_normalize(purple_connection_get_account(gc), name);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
70
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
71 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
72 if (!f) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
73 f = yahoo_friend_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
74 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
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 return f;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
78 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
79
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
80 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
81 {
22831
0b11895cc564 Leak fixes. Avoid creating an unnecessary parallel data structure to YahooFriend.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 19681
diff changeset
82 g_free(f->ip);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
83 f->ip = g_strdup(ip);
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
86 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
87 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
88 return f->ip;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
89 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
90
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
91 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
92 {
22831
0b11895cc564 Leak fixes. Avoid creating an unnecessary parallel data structure to YahooFriend.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 19681
diff changeset
93 g_free(f->game);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
94
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
95 if (game)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
96 f->game = g_strdup(game);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
97 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
98 f->game = NULL;
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
101 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
102 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
103 return f->game;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
104 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
105
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
106 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
107 {
22831
0b11895cc564 Leak fixes. Avoid creating an unnecessary parallel data structure to YahooFriend.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 19681
diff changeset
108 g_free(f->msg);
15373
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 f->msg = msg;
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
113 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
114 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
115 return f->msg;
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
118 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
119 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
120 f->bicon_sent_request = !needs;
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
123 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
124 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
125 return !f->bicon_sent_request;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
126 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
127
22831
0b11895cc564 Leak fixes. Avoid creating an unnecessary parallel data structure to YahooFriend.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 19681
diff changeset
128 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: 19681
diff changeset
129 {
27538
fa827f6f990f Add support for receiving contact details from buddies.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 27165
diff changeset
130 g_free(f->ypd.id);
fa827f6f990f Add support for receiving contact details from buddies.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 27165
diff changeset
131 f->ypd.id = g_strdup(alias_id);
22831
0b11895cc564 Leak fixes. Avoid creating an unnecessary parallel data structure to YahooFriend.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 19681
diff changeset
132 }
0b11895cc564 Leak fixes. Avoid creating an unnecessary parallel data structure to YahooFriend.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 19681
diff changeset
133
0b11895cc564 Leak fixes. Avoid creating an unnecessary parallel data structure to YahooFriend.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 19681
diff changeset
134 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: 19681
diff changeset
135 {
27538
fa827f6f990f Add support for receiving contact details from buddies.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 27165
diff changeset
136 return f->ypd.id;
22831
0b11895cc564 Leak fixes. Avoid creating an unnecessary parallel data structure to YahooFriend.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 19681
diff changeset
137 }
0b11895cc564 Leak fixes. Avoid creating an unnecessary parallel data structure to YahooFriend.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 19681
diff changeset
138
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
139 void yahoo_friend_free(gpointer p)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
140 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
141 YahooFriend *f = p;
22831
0b11895cc564 Leak fixes. Avoid creating an unnecessary parallel data structure to YahooFriend.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 19681
diff changeset
142 g_free(f->msg);
0b11895cc564 Leak fixes. Avoid creating an unnecessary parallel data structure to YahooFriend.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 19681
diff changeset
143 g_free(f->game);
0b11895cc564 Leak fixes. Avoid creating an unnecessary parallel data structure to YahooFriend.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 19681
diff changeset
144 g_free(f->ip);
27538
fa827f6f990f Add support for receiving contact details from buddies.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 27165
diff changeset
145 yahoo_personal_details_reset(&f->ypd, TRUE);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
146 g_free(f);
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
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
149 void yahoo_process_presence(PurpleConnection *gc, struct yahoo_packet *pkt)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
150 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
151 GSList *l = pkt->hash;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
152 YahooFriend *f;
26165
74bb0836f164 msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 26142
diff changeset
153 char *temp = NULL;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
154 char *who = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
155 int value = 0;
28364
61856d0a2714 Handle adding Lotus Sametime and Microsoft OCS buddies to Yahoo! accounts.
kryojenik23-pidgin@steltek.com
parents: 27694
diff changeset
156 YahooFederation fed = YAHOO_FEDERATION_NONE;
31086
a8cc50c2279f Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents: 29002
diff changeset
157
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
158 while (l) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
159 struct yahoo_pair *pair = l->data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
160
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
161 switch (pair->key) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
162 case 7:
26165
74bb0836f164 msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 26142
diff changeset
163 temp = pair->value;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
164 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
165 case 31:
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
166 value = strtol(pair->value, NULL, 10);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
167 break;
26165
74bb0836f164 msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 26142
diff changeset
168 case 241:
28364
61856d0a2714 Handle adding Lotus Sametime and Microsoft OCS buddies to Yahoo! accounts.
kryojenik23-pidgin@steltek.com
parents: 27694
diff changeset
169 fed = strtol(pair->value, NULL, 10);
26165
74bb0836f164 msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 26142
diff changeset
170 break;
15373
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
173 l = l->next;
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
27165
1a971a264c3e Fix a small leak.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26166
diff changeset
176 if (value != 1 && value != 2) {
1a971a264c3e Fix a small leak.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26166
diff changeset
177 purple_debug_error("yahoo", "Received unknown value for presence key: %d\n", value);
1a971a264c3e Fix a small leak.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26166
diff changeset
178 return;
1a971a264c3e Fix a small leak.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26166
diff changeset
179 }
31086
a8cc50c2279f Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents: 29002
diff changeset
180
28364
61856d0a2714 Handle adding Lotus Sametime and Microsoft OCS buddies to Yahoo! accounts.
kryojenik23-pidgin@steltek.com
parents: 27694
diff changeset
181 switch (fed) {
61856d0a2714 Handle adding Lotus Sametime and Microsoft OCS buddies to Yahoo! accounts.
kryojenik23-pidgin@steltek.com
parents: 27694
diff changeset
182 case YAHOO_FEDERATION_MSN:
61856d0a2714 Handle adding Lotus Sametime and Microsoft OCS buddies to Yahoo! accounts.
kryojenik23-pidgin@steltek.com
parents: 27694
diff changeset
183 who = g_strconcat("msn/", temp, NULL);
61856d0a2714 Handle adding Lotus Sametime and Microsoft OCS buddies to Yahoo! accounts.
kryojenik23-pidgin@steltek.com
parents: 27694
diff changeset
184 break;
61856d0a2714 Handle adding Lotus Sametime and Microsoft OCS buddies to Yahoo! accounts.
kryojenik23-pidgin@steltek.com
parents: 27694
diff changeset
185 case YAHOO_FEDERATION_OCS:
61856d0a2714 Handle adding Lotus Sametime and Microsoft OCS buddies to Yahoo! accounts.
kryojenik23-pidgin@steltek.com
parents: 27694
diff changeset
186 who = g_strconcat("ocs/", temp, NULL);
61856d0a2714 Handle adding Lotus Sametime and Microsoft OCS buddies to Yahoo! accounts.
kryojenik23-pidgin@steltek.com
parents: 27694
diff changeset
187 break;
61856d0a2714 Handle adding Lotus Sametime and Microsoft OCS buddies to Yahoo! accounts.
kryojenik23-pidgin@steltek.com
parents: 27694
diff changeset
188 case YAHOO_FEDERATION_IBM:
61856d0a2714 Handle adding Lotus Sametime and Microsoft OCS buddies to Yahoo! accounts.
kryojenik23-pidgin@steltek.com
parents: 27694
diff changeset
189 who = g_strconcat("ibm/", temp, NULL);
61856d0a2714 Handle adding Lotus Sametime and Microsoft OCS buddies to Yahoo! accounts.
kryojenik23-pidgin@steltek.com
parents: 27694
diff changeset
190 break;
29002
d1cecbc467c6 Support Yahoo !PingBox. Includes a couple warning fixes. Fixes #7347.
kartikmohta@gmail.com
parents: 28364
diff changeset
191 case YAHOO_FEDERATION_PBX:
d1cecbc467c6 Support Yahoo !PingBox. Includes a couple warning fixes. Fixes #7347.
kartikmohta@gmail.com
parents: 28364
diff changeset
192 who = g_strconcat("pbx/", temp, NULL);
d1cecbc467c6 Support Yahoo !PingBox. Includes a couple warning fixes. Fixes #7347.
kartikmohta@gmail.com
parents: 28364
diff changeset
193 break;
28364
61856d0a2714 Handle adding Lotus Sametime and Microsoft OCS buddies to Yahoo! accounts.
kryojenik23-pidgin@steltek.com
parents: 27694
diff changeset
194 case YAHOO_FEDERATION_NONE:
61856d0a2714 Handle adding Lotus Sametime and Microsoft OCS buddies to Yahoo! accounts.
kryojenik23-pidgin@steltek.com
parents: 27694
diff changeset
195 who = g_strdup(temp);
61856d0a2714 Handle adding Lotus Sametime and Microsoft OCS buddies to Yahoo! accounts.
kryojenik23-pidgin@steltek.com
parents: 27694
diff changeset
196 break;
61856d0a2714 Handle adding Lotus Sametime and Microsoft OCS buddies to Yahoo! accounts.
kryojenik23-pidgin@steltek.com
parents: 27694
diff changeset
197 }
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
198 g_return_if_fail(who != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
199
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
200 f = yahoo_friend_find(gc, who);
26165
74bb0836f164 msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 26142
diff changeset
201 if (!f) {
74bb0836f164 msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 26142
diff changeset
202 g_free(who);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
203 return;
26165
74bb0836f164 msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 26142
diff changeset
204 }
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
205
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
206 if (pkt->service == YAHOO_SERVICE_PRESENCE_PERM) {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
207 purple_debug_info("yahoo", "Setting permanent presence for %s to %d.\n", who, (value == 1));
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
208 /* 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
209 * 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
210 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
211 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
212 if (value == 1) /* Setting Perm offline */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
213 f->presence = YAHOO_PRESENCE_PERM_OFFLINE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
214 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
215 f->presence = YAHOO_PRESENCE_DEFAULT;
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 } else {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
218 purple_debug_info("yahoo", "Setting session presence for %s to %d.\n", who, (value == 1));
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
219 if (value == 1)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
220 f->presence = YAHOO_PRESENCE_ONLINE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
221 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
222 f->presence = YAHOO_PRESENCE_DEFAULT;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
223 }
26165
74bb0836f164 msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 26142
diff changeset
224 g_free(who);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
225 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
226
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
227 void yahoo_friend_update_presence(PurpleConnection *gc, const char *name,
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
228 YahooPresenceVisibility presence)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
229 {
31998
fcf841ffd620 Convert yahoo prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data()
andrew.victor@mxit.com
parents: 31086
diff changeset
230 YahooData *yd = purple_connection_get_protocol_data(gc);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
231 struct yahoo_packet *pkt = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
232 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: 15822
diff changeset
233 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: 15822
diff changeset
234 int service = -1;
26165
74bb0836f164 msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 26142
diff changeset
235 const char *temp = NULL;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
236
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
237 if (!yd->logged_in)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
238 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
239
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
240 f = yahoo_friend_find(gc, name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
241 if (!f)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
242 return;
31086
a8cc50c2279f Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents: 29002
diff changeset
243
28364
61856d0a2714 Handle adding Lotus Sametime and Microsoft OCS buddies to Yahoo! accounts.
kryojenik23-pidgin@steltek.com
parents: 27694
diff changeset
244 if(f->fed != YAHOO_FEDERATION_NONE)
26165
74bb0836f164 msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 26142
diff changeset
245 temp = name+4;
74bb0836f164 msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 26142
diff changeset
246 else
74bb0836f164 msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 26142
diff changeset
247 temp = name;
31086
a8cc50c2279f Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents: 29002
diff changeset
248
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
249 /* 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
250 if (f->presence == presence) {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
251 purple_debug_info("yahoo", "Not setting presence because there are no changes.\n");
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
252 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
253 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
254
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
255 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: 15822
diff changeset
256 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: 15822
diff changeset
257 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: 15822
diff changeset
258 thirteen = "2";
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
259 } else if (presence == YAHOO_PRESENCE_DEFAULT) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
260 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: 15822
diff changeset
261 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: 15822
diff changeset
262 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: 15822
diff changeset
263 thirteen = "2";
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
264 } 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: 15822
diff changeset
265 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: 15822
diff changeset
266 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: 15822
diff changeset
267 thirteen = "1";
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
268 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
269 } else if (presence == YAHOO_PRESENCE_ONLINE) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
270 if (f->presence == YAHOO_PRESENCE_PERM_OFFLINE) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
271 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
272 YAHOO_STATUS_AVAILABLE, yd->session_id);
28364
61856d0a2714 Handle adding Lotus Sametime and Microsoft OCS buddies to Yahoo! accounts.
kryojenik23-pidgin@steltek.com
parents: 27694
diff changeset
273 if(f->fed)
26142
3b19ea3c8165 MSN Interoperability, add, remove buddies, change group, send im, etc
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 25067
diff changeset
274 yahoo_packet_hash(pkt, "ssssssiss",
3b19ea3c8165 MSN Interoperability, add, remove buddies, change group, send im, etc
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 25067
diff changeset
275 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: 25067
diff changeset
276 31, "2", 13, "2",
3b19ea3c8165 MSN Interoperability, add, remove buddies, change group, send im, etc
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 25067
diff changeset
277 302, "319", 300, "319",
28364
61856d0a2714 Handle adding Lotus Sametime and Microsoft OCS buddies to Yahoo! accounts.
kryojenik23-pidgin@steltek.com
parents: 27694
diff changeset
278 7, temp, 241, f->fed,
26142
3b19ea3c8165 MSN Interoperability, add, remove buddies, change group, send im, etc
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 25067
diff changeset
279 301, "319", 303, "319");
3b19ea3c8165 MSN Interoperability, add, remove buddies, change group, send im, etc
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 25067
diff changeset
280 else
3b19ea3c8165 MSN Interoperability, add, remove buddies, change group, send im, etc
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 25067
diff changeset
281 yahoo_packet_hash(pkt, "ssssssss",
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
282 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: 15822
diff changeset
283 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: 15822
diff changeset
284 302, "319", 300, "319",
26165
74bb0836f164 msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 26142
diff changeset
285 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: 15822
diff changeset
286 301, "319", 303, "319");
26142
3b19ea3c8165 MSN Interoperability, add, remove buddies, change group, send im, etc
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 25067
diff changeset
287
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
288 yahoo_packet_send_and_free(pkt, yd);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
289 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
290
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: 15822
diff changeset
291 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: 15822
diff changeset
292 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: 15822
diff changeset
293 thirteen = "1";
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
294 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
295
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: 15822
diff changeset
296 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: 15822
diff changeset
297 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: 15822
diff changeset
298 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: 15822
diff changeset
299
28364
61856d0a2714 Handle adding Lotus Sametime and Microsoft OCS buddies to Yahoo! accounts.
kryojenik23-pidgin@steltek.com
parents: 27694
diff changeset
300 if(f->fed)
26142
3b19ea3c8165 MSN Interoperability, add, remove buddies, change group, send im, etc
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 25067
diff changeset
301 yahoo_packet_hash(pkt, "ssssssiss",
3b19ea3c8165 MSN Interoperability, add, remove buddies, change group, send im, etc
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 25067
diff changeset
302 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: 25067
diff changeset
303 31, thirtyone, 13, thirteen,
3b19ea3c8165 MSN Interoperability, add, remove buddies, change group, send im, etc
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 25067
diff changeset
304 302, "319", 300, "319",
28364
61856d0a2714 Handle adding Lotus Sametime and Microsoft OCS buddies to Yahoo! accounts.
kryojenik23-pidgin@steltek.com
parents: 27694
diff changeset
305 7, temp, 241, f->fed,
26142
3b19ea3c8165 MSN Interoperability, add, remove buddies, change group, send im, etc
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 25067
diff changeset
306 301, "319", 303, "319");
3b19ea3c8165 MSN Interoperability, add, remove buddies, change group, send im, etc
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 25067
diff changeset
307 else
3b19ea3c8165 MSN Interoperability, add, remove buddies, change group, send im, etc
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 25067
diff changeset
308 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: 15822
diff changeset
309 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: 15822
diff changeset
310 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: 15822
diff changeset
311 302, "319", 300, "319",
26165
74bb0836f164 msn interoperability : presence settings
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 26142
diff changeset
312 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: 15822
diff changeset
313 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: 15822
diff changeset
314
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
315 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: 15822
diff changeset
316 }
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
317 }
25059
f16aba67b685 Sending of p2p packet, providing peer with our IP address to make a connection to us.
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 22831
diff changeset
318
f16aba67b685 Sending of p2p packet, providing peer with our IP address to make a connection to us.
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 22831
diff changeset
319 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: 22831
diff changeset
320 {
f16aba67b685 Sending of p2p packet, providing peer with our IP address to make a connection to us.
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 22831
diff changeset
321 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: 22831
diff changeset
322 }
f16aba67b685 Sending of p2p packet, providing peer with our IP address to make a connection to us.
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 22831
diff changeset
323
f16aba67b685 Sending of p2p packet, providing peer with our IP address to make a connection to us.
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 22831
diff changeset
324 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: 22831
diff changeset
325 {
f16aba67b685 Sending of p2p packet, providing peer with our IP address to make a connection to us.
Sulabh Mahajan <sulabh@soc.pidgin.im>
parents: 22831
diff changeset
326 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: 22831
diff changeset
327 }