libpurple/protocols/jabber/presence.c

changeset 25154
492b9d6b48a5
parent 25110
40b3fffdb00b
child 25228
22eae6415b50
child 25482
d3ab10d1c900
child 25737
7f6a23aa9e8e
child 25810
5cf3c22e52df
child 26042
4dabdb5fe213
child 26178
2081d31d5466
equal deleted inserted replaced
25153:7e8bdb57a11f 25154:492b9d6b48a5
500 char *p = xmlnode_get_data(y); 500 char *p = xmlnode_get_data(y);
501 if(p) { 501 if(p) {
502 priority = atoi(p); 502 priority = atoi(p);
503 g_free(p); 503 g_free(p);
504 } 504 }
505 } else if(xmlns == NULL) {
506 /* The rest of the cases used to check xmlns individually. */
507 continue;
505 } else if(!strcmp(y->name, "delay") && !strcmp(xmlns, "urn:xmpp:delay")) { 508 } else if(!strcmp(y->name, "delay") && !strcmp(xmlns, "urn:xmpp:delay")) {
506 /* XXX: compare the time. jabber:x:delay can happen on presence packets that aren't really and truly delayed */ 509 /* XXX: compare the time. jabber:x:delay can happen on presence packets that aren't really and truly delayed */
507 delayed = TRUE; 510 delayed = TRUE;
508 } else if(xmlns && !strcmp(y->name, "c") && !strcmp(xmlns, "http://jabber.org/protocol/caps")) { 511 } else if(!strcmp(y->name, "c") && !strcmp(xmlns, "http://jabber.org/protocol/caps")) {
509 caps = y; /* store for later, when creating buddy resource */ 512 caps = y; /* store for later, when creating buddy resource */
510 } else if(!strcmp(y->name, "x")) { 513 } else if(!strcmp(y->name, "x")) {
511 const char *xmlns = xmlnode_get_namespace(y); 514 if(!strcmp(xmlns, "jabber:x:delay")) {
512 if(xmlns && !strcmp(xmlns, "jabber:x:delay")) {
513 /* XXX: compare the time. jabber:x:delay can happen on presence packets that aren't really and truly delayed */ 515 /* XXX: compare the time. jabber:x:delay can happen on presence packets that aren't really and truly delayed */
514 delayed = TRUE; 516 delayed = TRUE;
515 } else if(xmlns && !strcmp(xmlns, "http://jabber.org/protocol/muc#user")) { 517 } else if(!strcmp(xmlns, "http://jabber.org/protocol/muc#user")) {
516 xmlnode *z; 518 xmlnode *z;
517 519
518 muc = TRUE; 520 muc = TRUE;
519 if((z = xmlnode_get_child(y, "status"))) { 521 if((z = xmlnode_get_child(y, "status"))) {
520 const char *code = xmlnode_get_attrib(z, "code"); 522 const char *code = xmlnode_get_attrib(z, "code");
553 flags |= PURPLE_CBFLAGS_OP; 555 flags |= PURPLE_CBFLAGS_OP;
554 else if (!strcmp(role, "participant")) 556 else if (!strcmp(role, "participant"))
555 flags |= PURPLE_CBFLAGS_VOICE; 557 flags |= PURPLE_CBFLAGS_VOICE;
556 } 558 }
557 } 559 }
558 } else if(xmlns && !strcmp(xmlns, "vcard-temp:x:update")) { 560 } else if(!strcmp(xmlns, "vcard-temp:x:update")) {
559 xmlnode *photo = xmlnode_get_child(y, "photo"); 561 xmlnode *photo = xmlnode_get_child(y, "photo");
560 if(photo) { 562 if(photo) {
561 g_free(avatar_hash); 563 g_free(avatar_hash);
562 avatar_hash = xmlnode_get_data(photo); 564 avatar_hash = xmlnode_get_data(photo);
563 } 565 }

mercurial