Wed, 12 Nov 2008 05:14:03 +0000
merge of '77693555855fe9cd3215414f79964dba346cc5fa'
and '19a87e98e5857ad0289f2c760d460f7f1dbbb42d'
| 9278 | 1 | /* |
| 2 | * gaim | |
| 3 | * | |
| 4 | * Gaim is the legal property of its developers, whose names are too numerous | |
| 5 | * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 6 | * source distribution. | |
| 7 | * | |
| 8 | * This program is free software; you can redistribute it and/or modify | |
| 9 | * it under the terms of the GNU General Public License as published by | |
| 10 | * the Free Software Foundation; either version 2 of the License, or | |
| 11 | * (at your option) any later version. | |
| 12 | * | |
| 13 | * This program is distributed in the hope that it will be useful, | |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 | * GNU General Public License for more details. | |
| 17 | * | |
| 18 | * You should have received a copy of the GNU General Public License | |
| 19 | * along with this program; if not, write to the Free Software | |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 21 | * | |
| 22 | */ | |
| 23 | ||
|
10989
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
24 | #include "internal.h" |
| 9278 | 25 | #include "prpl.h" |
| 9279 | 26 | #include "util.h" |
|
10989
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
27 | #include "debug.h" |
| 9278 | 28 | |
| 29 | #include "yahoo_friend.h" | |
| 30 | ||
| 9283 | 31 | static YahooFriend *yahoo_friend_new(void) |
| 9278 | 32 | { |
| 33 | YahooFriend *ret; | |
| 34 | ||
| 35 | ret = g_new0(YahooFriend, 1); | |
| 36 | ret->status = YAHOO_STATUS_OFFLINE; | |
|
12010
aa2f3b07ec09
[gaim-migrate @ 14303]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11644
diff
changeset
|
37 | ret->presence = YAHOO_PRESENCE_DEFAULT; |
| 9278 | 38 | |
| 39 | return ret; | |
| 40 | } | |
| 41 | ||
| 9279 | 42 | YahooFriend *yahoo_friend_find(GaimConnection *gc, const char *name) |
| 43 | { | |
| 44 | struct yahoo_data *yd; | |
| 45 | const char *norm; | |
| 46 | ||
| 47 | g_return_val_if_fail(gc != NULL, NULL); | |
| 48 | g_return_val_if_fail(gc->proto_data != NULL, NULL); | |
| 49 | ||
| 50 | yd = gc->proto_data; | |
| 51 | norm = gaim_normalize(gaim_connection_get_account(gc), name); | |
| 52 | ||
| 53 | return g_hash_table_lookup(yd->friends, norm); | |
| 54 | } | |
| 55 | ||
| 56 | YahooFriend *yahoo_friend_find_or_new(GaimConnection *gc, const char *name) | |
| 57 | { | |
| 58 | YahooFriend *f; | |
| 59 | struct yahoo_data *yd; | |
| 60 | const char *norm; | |
| 61 | ||
| 62 | g_return_val_if_fail(gc != NULL, NULL); | |
| 63 | g_return_val_if_fail(gc->proto_data != NULL, NULL); | |
| 64 | ||
| 65 | yd = gc->proto_data; | |
| 66 | norm = gaim_normalize(gaim_connection_get_account(gc), name); | |
| 67 | ||
| 68 | f = g_hash_table_lookup(yd->friends, norm); | |
| 69 | if (!f) { | |
| 70 | f = yahoo_friend_new(); | |
| 71 | g_hash_table_insert(yd->friends, g_strdup(norm), f); | |
| 72 | } | |
| 73 | ||
| 74 | return f; | |
| 75 | } | |
| 76 | ||
| 9281 | 77 | void yahoo_friend_set_ip(YahooFriend *f, const char *ip) |
| 78 | { | |
| 79 | if (f->ip) | |
| 80 | g_free(f->ip); | |
| 81 | f->ip = g_strdup(ip); | |
| 82 | } | |
| 83 | ||
| 84 | const char *yahoo_friend_get_ip(YahooFriend *f) | |
| 85 | { | |
| 86 | return f->ip; | |
| 87 | } | |
| 88 | ||
| 9283 | 89 | void yahoo_friend_set_game(YahooFriend *f, const char *game) |
| 90 | { | |
| 91 | if (f->game) | |
| 92 | g_free(f->game); | |
| 93 | ||
| 94 | if (game) | |
| 95 | f->game = g_strdup(game); | |
| 96 | else | |
| 97 | f->game = NULL; | |
| 98 | } | |
| 99 | ||
| 100 | const char *yahoo_friend_get_game(YahooFriend *f) | |
| 101 | { | |
| 102 | return f->game; | |
| 103 | } | |
| 104 | ||
| 105 | void yahoo_friend_set_status_message(YahooFriend *f, char *msg) | |
| 106 | { | |
| 107 | if (f->msg) | |
| 108 | g_free(f->msg); | |
| 109 | ||
| 110 | f->msg = msg; | |
| 111 | } | |
| 112 | ||
| 113 | const char *yahoo_friend_get_status_message(YahooFriend *f) | |
| 114 | { | |
| 115 | return f->msg; | |
| 116 | } | |
| 117 | ||
| 9284 | 118 | void yahoo_friend_set_buddy_icon_need_request(YahooFriend *f, gboolean needs) |
| 119 | { | |
| 120 | f->bicon_sent_request = !needs; | |
| 121 | } | |
| 122 | ||
| 123 | gboolean yahoo_friend_get_buddy_icon_need_request(YahooFriend *f) | |
| 124 | { | |
| 125 | return !f->bicon_sent_request; | |
| 126 | } | |
| 127 | ||
| 9278 | 128 | void yahoo_friend_free(gpointer p) |
| 129 | { | |
| 130 | YahooFriend *f = p; | |
| 131 | if (f->msg) | |
| 132 | g_free(f->msg); | |
| 133 | if (f->game) | |
| 134 | g_free(f->game); | |
| 9282 | 135 | if (f->ip) |
| 136 | g_free(f->ip); | |
| 9278 | 137 | g_free(f); |
| 138 | } | |
|
10989
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
139 | |
|
12010
aa2f3b07ec09
[gaim-migrate @ 14303]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11644
diff
changeset
|
140 | void yahoo_process_presence(GaimConnection *gc, struct yahoo_packet *pkt) |
|
10989
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
141 | { |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
142 | GSList *l = pkt->hash; |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
143 | YahooFriend *f; |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
144 | char *who = NULL; |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
145 | int value = 0; |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
146 | |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
147 | while (l) { |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
148 | struct yahoo_pair *pair = l->data; |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
149 | |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
150 | switch (pair->key) { |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
151 | case 7: |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
152 | who = pair->value; |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
153 | break; |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
154 | case 31: |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
155 | value = strtol(pair->value, NULL, 10); |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
156 | break; |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
157 | } |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
158 | |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
159 | l = l->next; |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
160 | } |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
161 | |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
162 | if (value != 1 && value != 2) { |
|
12010
aa2f3b07ec09
[gaim-migrate @ 14303]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11644
diff
changeset
|
163 | gaim_debug_error("yahoo", "Received unknown value for presence key: %d\n", value); |
|
10989
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
164 | return; |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
165 | } |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
166 | |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
167 | g_return_if_fail(who != NULL); |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
168 | |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
169 | f = yahoo_friend_find(gc, who); |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
170 | if (!f) |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
171 | return; |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
172 | |
|
12010
aa2f3b07ec09
[gaim-migrate @ 14303]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11644
diff
changeset
|
173 | if (pkt->service == YAHOO_SERVICE_PRESENCE_PERM) { |
|
aa2f3b07ec09
[gaim-migrate @ 14303]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11644
diff
changeset
|
174 | gaim_debug_info("yahoo", "Setting permanent presence for %s to %d.\n", who, (value == 1)); |
|
10989
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
175 | /* If setting from perm offline to online when in invisible status, |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
176 | * this has already been taken care of (when the temp status changed) */ |
|
12010
aa2f3b07ec09
[gaim-migrate @ 14303]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11644
diff
changeset
|
177 | if (value == 2 && f->presence == YAHOO_PRESENCE_ONLINE) { |
|
10989
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
178 | } else { |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
179 | if (value == 1) /* Setting Perm offline */ |
|
12010
aa2f3b07ec09
[gaim-migrate @ 14303]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11644
diff
changeset
|
180 | f->presence = YAHOO_PRESENCE_PERM_OFFLINE; |
|
10989
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
181 | else |
|
12010
aa2f3b07ec09
[gaim-migrate @ 14303]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11644
diff
changeset
|
182 | f->presence = YAHOO_PRESENCE_DEFAULT; |
|
10989
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
183 | } |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
184 | } else { |
|
12010
aa2f3b07ec09
[gaim-migrate @ 14303]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11644
diff
changeset
|
185 | gaim_debug_info("yahoo", "Setting session presence for %s to %d.\n", who, (value == 1)); |
|
10989
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
186 | if (value == 1) |
|
12010
aa2f3b07ec09
[gaim-migrate @ 14303]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11644
diff
changeset
|
187 | f->presence = YAHOO_PRESENCE_ONLINE; |
|
10989
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
188 | else |
|
12010
aa2f3b07ec09
[gaim-migrate @ 14303]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11644
diff
changeset
|
189 | f->presence = YAHOO_PRESENCE_DEFAULT; |
|
10989
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
190 | } |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
191 | } |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
192 | |
|
12010
aa2f3b07ec09
[gaim-migrate @ 14303]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11644
diff
changeset
|
193 | void yahoo_friend_update_presence(GaimConnection *gc, const char *name, |
|
aa2f3b07ec09
[gaim-migrate @ 14303]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11644
diff
changeset
|
194 | YahooPresenceVisibility presence) |
|
10989
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
195 | { |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
196 | struct yahoo_data *yd = gc->proto_data; |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
197 | struct yahoo_packet *pkt = NULL; |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
198 | YahooFriend *f; |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
199 | |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
200 | if (!yd->logged_in) |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
201 | return; |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
202 | |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
203 | f = yahoo_friend_find(gc, name); |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
204 | if (!f) |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
205 | return; |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
206 | |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
207 | /* No need to change the value if it is already correct */ |
|
12010
aa2f3b07ec09
[gaim-migrate @ 14303]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11644
diff
changeset
|
208 | if (f->presence == presence) { |
|
aa2f3b07ec09
[gaim-migrate @ 14303]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11644
diff
changeset
|
209 | gaim_debug_info("yahoo", "Not setting presence because there are no changes.\n"); |
|
10989
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
210 | return; |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
211 | } |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
212 | |
|
12010
aa2f3b07ec09
[gaim-migrate @ 14303]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11644
diff
changeset
|
213 | if (presence == YAHOO_PRESENCE_PERM_OFFLINE) { |
|
aa2f3b07ec09
[gaim-migrate @ 14303]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11644
diff
changeset
|
214 | pkt = yahoo_packet_new(YAHOO_SERVICE_PRESENCE_PERM, |
|
10989
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
215 | YAHOO_STATUS_AVAILABLE, yd->session_id); |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
216 | |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
217 | yahoo_packet_hash(pkt, "ssss", |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
218 | 1, gaim_connection_get_display_name(gc), |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
219 | 31, "1", 13, "2", 7, name); |
|
12010
aa2f3b07ec09
[gaim-migrate @ 14303]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11644
diff
changeset
|
220 | } else if (presence == YAHOO_PRESENCE_DEFAULT) { |
|
aa2f3b07ec09
[gaim-migrate @ 14303]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11644
diff
changeset
|
221 | if (f->presence == YAHOO_PRESENCE_PERM_OFFLINE) { |
|
aa2f3b07ec09
[gaim-migrate @ 14303]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11644
diff
changeset
|
222 | pkt = yahoo_packet_new(YAHOO_SERVICE_PRESENCE_PERM, |
|
10989
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
223 | YAHOO_STATUS_AVAILABLE, yd->session_id); |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
224 | |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
225 | yahoo_packet_hash(pkt, "ssss", |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
226 | 1, gaim_connection_get_display_name(gc), |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
227 | 31, "2", 13, "2", 7, name); |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
228 | } else if (yd->current_status == YAHOO_STATUS_INVISIBLE) { |
|
12010
aa2f3b07ec09
[gaim-migrate @ 14303]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11644
diff
changeset
|
229 | pkt = yahoo_packet_new(YAHOO_SERVICE_PRESENCE_SESSION, |
|
10989
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
230 | YAHOO_STATUS_AVAILABLE, yd->session_id); |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
231 | yahoo_packet_hash(pkt, "ssss", |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
232 | 1, gaim_connection_get_display_name(gc), |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
233 | 31, "2", 13, "1", 7, name); |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
234 | } |
|
12010
aa2f3b07ec09
[gaim-migrate @ 14303]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11644
diff
changeset
|
235 | } else if (presence == YAHOO_PRESENCE_ONLINE) { |
|
aa2f3b07ec09
[gaim-migrate @ 14303]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11644
diff
changeset
|
236 | if (f->presence == YAHOO_PRESENCE_PERM_OFFLINE) { |
|
aa2f3b07ec09
[gaim-migrate @ 14303]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11644
diff
changeset
|
237 | pkt = yahoo_packet_new(YAHOO_SERVICE_PRESENCE_PERM, |
|
10989
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
238 | YAHOO_STATUS_AVAILABLE, yd->session_id); |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
239 | yahoo_packet_hash(pkt, "ssss", |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
240 | 1, gaim_connection_get_display_name(gc), |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
241 | 31, "2", 13, "2", 7, name); |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
242 | yahoo_packet_send_and_free(pkt, yd); |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
243 | } |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
244 | |
|
12010
aa2f3b07ec09
[gaim-migrate @ 14303]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11644
diff
changeset
|
245 | pkt = yahoo_packet_new(YAHOO_SERVICE_PRESENCE_SESSION, |
|
10989
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
246 | YAHOO_STATUS_AVAILABLE, yd->session_id); |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
247 | yahoo_packet_hash(pkt, "ssss", |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
248 | 1, gaim_connection_get_display_name(gc), |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
249 | 31, "1", 13, "1", 7, name); |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
250 | } |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
251 | |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
252 | if (pkt) |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
253 | yahoo_packet_send_and_free(pkt, yd); |
|
ea41b63cfea5
[gaim-migrate @ 12827]
Daniel Atallah <datallah@pidgin.im>
parents:
9284
diff
changeset
|
254 | } |