Changeset 29ff5c2 for protocols/jabber/jabber.c
- Timestamp:
- 2015-11-21T00:01:50Z (8 years ago)
- Parents:
- e4f08bf (diff), 8fdeaa5 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/jabber.c
re4f08bf r29ff5c2 85 85 set_setstr(&acc->set, "server", "chat.hipchat.com"); 86 86 } else { 87 s = set_add(&acc->set, "oauth", "false", set_eval_oauth, acc); 87 set_add(&acc->set, "oauth", "false", set_eval_oauth, acc); 88 89 /* this reuses set_eval_oauth, which clears the password */ 90 set_add(&acc->set, "anonymous", "false", set_eval_oauth, acc); 88 91 } 89 92 … … 194 197 } else { 195 198 jabber_connect(ic); 199 } 200 } 201 202 static void jabber_xmlconsole_enable(struct im_connection *ic) 203 { 204 struct jabber_data *jd = ic->proto_data; 205 const char *handle = JABBER_XMLCONSOLE_HANDLE; 206 bee_user_t *bu; 207 208 jd->flags |= JFLAG_XMLCONSOLE; 209 210 if (!(bu = bee_user_by_handle(ic->bee, ic, handle))) { 211 bu = bee_user_new(ic->bee, ic, handle, 0); 212 bu->flags |= BEE_USER_NOOTR; 196 213 } 197 214 } … … 263 280 264 281 if (set_getbool(&acc->set, "xmlconsole")) { 265 jd->flags |= JFLAG_XMLCONSOLE; 266 /* Shouldn't really do this at this stage already, maybe. But 267 I think this shouldn't break anything. */ 268 imcb_add_buddy(ic, JABBER_XMLCONSOLE_HANDLE, NULL); 282 jabber_xmlconsole_enable(ic); 269 283 } 270 284 … … 331 345 } 332 346 if (jd->fd >= 0) { 333 closesocket(jd->fd);347 proxy_disconnect(jd->fd); 334 348 } 335 349 … … 342 356 } 343 357 344 jabber_buddy_remove_all(ic); 358 if (jd->buddies) { 359 jabber_buddy_remove_all(ic); 360 } 345 361 346 362 xt_free(jd->xt); … … 469 485 static void jabber_add_buddy(struct im_connection *ic, char *who, char *group) 470 486 { 471 struct jabber_data *jd = ic->proto_data;472 473 487 if (g_strcasecmp(who, JABBER_XMLCONSOLE_HANDLE) == 0) { 474 jd->flags |= JFLAG_XMLCONSOLE; 475 imcb_add_buddy(ic, JABBER_XMLCONSOLE_HANDLE, NULL); 488 jabber_xmlconsole_enable(ic); 476 489 return; 477 490 } … … 587 600 { 588 601 struct jabber_data *jd = ic->proto_data; 589 struct jabber_buddy *bud ;602 struct jabber_buddy *bud, *bare; 590 603 591 604 /* Enable typing notification related code from now. */ 592 605 jd->flags |= JFLAG_WANT_TYPING; 593 606 594 if ((bud = jabber_buddy_by_jid(ic, who, 0)) == NULL) { 607 if ((bud = jabber_buddy_by_jid(ic, who, 0)) == NULL || 608 (bare = jabber_buddy_by_jid(ic, who, GET_BUDDY_BARE)) == NULL) { 595 609 /* Sending typing notifications to unknown buddies is 596 610 unsupported for now. Shouldn't be a problem, I think. */ … … 598 612 } 599 613 600 if (bud->flags & JBFLAG_DOES_XEP85) { 614 615 if (bud->flags & JBFLAG_DOES_XEP85 || bare->flags & JBFLAG_DOES_XEP85) { 601 616 /* We're only allowed to send this stuff if we know the other 602 side supports it. */ 617 side supports it. If the bare JID has the flag, all other 618 resources get it, too (That is the case in gtalk) */ 603 619 604 620 struct xt_node *node;
Note: See TracChangeset
for help on using the changeset viewer.