comparison src/protocols/jabber/chat.c @ 10941:cef48e318125

[gaim-migrate @ 12731] sick of having my tree be so far out of sync...here's all my jabber stuff most notable is the "iChat" buddy icon support committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Thu, 26 May 2005 04:13:06 +0000
parents c4cb90065e1d
children b6cafdeda2a8
comparison
equal deleted inserted replaced
10940:999555fbbbd9 10941:cef48e318125
881 jabber_iq_send(iq); 881 jabber_iq_send(iq);
882 882
883 return TRUE; 883 return TRUE;
884 } 884 }
885 885
886 886 static void jabber_chat_disco_traffic_cb(JabberStream *js, xmlnode *packet, gpointer data)
887 887 {
888 JabberChat *chat;
889 xmlnode *query, *x, *error;
890 int id = GPOINTER_TO_INT(data);
891
892 if(!(chat = jabber_chat_find_by_id(js, id)))
893 return;
894
895 if((error = xmlnode_get_child(packet, "error"))) {
896 /* defaults, in case the conference server doesn't
897 * support this request */
898 chat->xhtml = TRUE;
899 return;
900 }
901
902 if(!(query = xmlnode_get_child(packet, "query")))
903 return;
904
905 for(x = xmlnode_get_child(query, "feature"); x; x = xmlnode_get_next_twin(x)) {
906 const char *var = xmlnode_get_attrib(x, "var");
907
908 if(var && !strcmp(var, "http://jabber.org/protocol/xhtml-im")) {
909 chat->xhtml = TRUE;
910 }
911 }
912 }
913
914 void jabber_chat_disco_traffic(JabberChat *chat)
915 {
916 JabberIq *iq;
917 xmlnode *query;
918
919 iq = jabber_iq_new_query(chat->js, JABBER_IQ_GET,
920 "http://jabber.org/protocol/disco#info");
921
922 query = xmlnode_get_child(iq->node, "query");
923
924 xmlnode_set_attrib(query, "node", "http://jabber.org/protocol/muc#traffic");
925
926 jabber_iq_set_callback(iq, jabber_chat_disco_traffic_cb, GINT_TO_POINTER(chat->id));
927
928 jabber_iq_send(iq);
929 }
930
931
932