# HG changeset patch # User Andreas Monitzer # Date 1181478159 0 # Node ID cac26c30047aa9763a29c895234ccf0dd57655bf # Parent 0370da969e8adc9b7253d3aadc5a20db4c6621ec Implemented for x-data forms, simplified malloc/sprintf, message type headline is not a requirement for incoming PEP messages (it is just recommended to avoid offline message storage). diff -r 0370da969e8a -r cac26c30047a libpurple/protocols/jabber/message.c --- a/libpurple/protocols/jabber/message.c Wed Jun 06 02:07:53 2007 +0000 +++ b/libpurple/protocols/jabber/message.c Sun Jun 10 12:22:39 2007 +0000 @@ -354,8 +354,7 @@ } else if(!strcmp(child->name, "gone") && !strcmp(xmlns,"http://jabber.org/protocol/chatstates")) { jm->chat_state = JM_STATE_GONE; jm->typing_style |= JM_TS_JEP_0085; - } else if(!strcmp(child->name, "event") && jm->type == JABBER_MESSAGE_HEADLINE && - !strcmp(xmlns,"http://jabber.org/protocol/pubsub#event")) { + } else if(!strcmp(child->name, "event") && !strcmp(xmlns,"http://jabber.org/protocol/pubsub#event")) { xmlnode *items; jm->type = JABBER_MESSAGE_EVENT; for(items = child->child; child; child = child->next) diff -r 0370da969e8a -r cac26c30047a libpurple/protocols/jabber/pep.c --- a/libpurple/protocols/jabber/pep.c Wed Jun 06 02:07:53 2007 +0000 +++ b/libpurple/protocols/jabber/pep.c Sun Jun 10 12:22:39 2007 +0000 @@ -34,10 +34,9 @@ } void jabber_pep_register_handler(const char *shortname, const char *xmlns, JabberPEPHandler handlerfunc) { - char *notifyns = malloc(strlen(xmlns) + 8); - sprintf(notifyns,"%s+notify", xmlns); + gchar *notifyns = g_strdup_printf("%s+notify", xmlns); jabber_add_feature(shortname, notifyns); - free(notifyns); + g_free(notifyns); g_hash_table_replace(pep_handlers, g_strdup(xmlns), handlerfunc); } diff -r 0370da969e8a -r cac26c30047a libpurple/protocols/jabber/xdata.c --- a/libpurple/protocols/jabber/xdata.c Wed Jun 06 02:07:53 2007 +0000 +++ b/libpurple/protocols/jabber/xdata.c Sun Jun 10 12:22:39 2007 +0000 @@ -191,8 +191,6 @@ value = xmlnode_get_data(valuenode); - /* XXX: handle */ - if(!strcmp(type, "text-private")) { if((valuenode = xmlnode_get_child(fn, "value"))) value = xmlnode_get_data(valuenode); @@ -324,6 +322,9 @@ g_free(value); } + + if(field && xmlnode_get_child(fn, "required")) + purple_request_field_set_required(field,TRUE); } if((x = xmlnode_get_child(packet, "title")))