comparison libgaim/protocols/jabber/presence.c @ 15136:31603a03cc02

[gaim-migrate @ 17921] Etan had changed the account notify stuff so that the prpl decides if the person is a buddy or not; I totally wiped that out with my authorization stuff. This brings it back. Additionally, I added a googletalk flag to JabberStream which can determine at runtime if you're connected to Google Talk. All of the Google Talk extensions can be detected individually with disco, but this might be used for working with perfectly standard XMPP that's implemented in what might be considered a quirky way in Google Talk. For instance, Google Talk automatically adds buddies to your roster when you authorize them to add you. I was going to use this flag so that the Jabber prpl would never ask me to add a Google Talk buddy who's just been automatically added anyway. I decided to keep it, though, since I may still want to specify what group he's in. This opens the door for more Google Talk customization though >:) committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Fri, 08 Dec 2006 02:51:47 +0000
parents f227feab8c78
children dfaad00e60dd
comparison
equal deleted inserted replaced
15135:9e1d9c9229ce 15136:31603a03cc02
278 278
279 state = JABBER_BUDDY_STATE_ERROR; 279 state = JABBER_BUDDY_STATE_ERROR;
280 jb->error_msg = msg ? msg : g_strdup(_("Unknown Error in presence")); 280 jb->error_msg = msg ? msg : g_strdup(_("Unknown Error in presence"));
281 } else if(type && !strcmp(type, "subscribe")) { 281 } else if(type && !strcmp(type, "subscribe")) {
282 struct _jabber_add_permit *jap = g_new0(struct _jabber_add_permit, 1); 282 struct _jabber_add_permit *jap = g_new0(struct _jabber_add_permit, 1);
283 283 gboolean onlist = FALSE;
284 GaimBuddy *buddy = gaim_find_buddy(gaim_connection_get_account(js->gc), from);
285 JabberBuddy *jb = NULL;
286
287 if (buddy) {
288 jb = jabber_buddy_find(js, from, TRUE);
289 if ((jb->subscription & JABBER_SUB_TO) == 0)
290 onlist = TRUE;
291 }
292
284 jap->gc = js->gc; 293 jap->gc = js->gc;
285 jap->who = g_strdup(from); 294 jap->who = g_strdup(from);
286 jap->js = js; 295 jap->js = js;
287 296
288 gaim_account_request_authorization(gaim_connection_get_account(js->gc), from, NULL, NULL, NULL, 297 gaim_account_request_authorization(gaim_connection_get_account(js->gc), from, NULL, NULL, NULL, onlist,
289 G_CALLBACK(authorize_add_cb), G_CALLBACK(deny_add_cb), jap); 298 G_CALLBACK(authorize_add_cb), G_CALLBACK(deny_add_cb), jap);
290 jabber_id_free(jid); 299 jabber_id_free(jid);
291 return; 300 return;
292 } else if(type && !strcmp(type, "subscribed")) { 301 } else if(type && !strcmp(type, "subscribed")) {
293 /* we've been allowed to see their presence, but we don't care */ 302 /* we've been allowed to see their presence, but we don't care */
294 jabber_id_free(jid); 303 jabber_id_free(jid);