Changeset 91ae87d


Ignore:
Timestamp:
2012-10-28T23:54:21Z (12 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
f21ad37
Parents:
4d82e50 (diff), 1444be5 (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.
Message:

Merging XEP-0184 support patch from Michael Stapelberg, #999.

Location:
protocols/jabber
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/iq.c

    r4d82e50 r91ae87d  
    128128                                                   XMLNS_MUC,
    129129                                                   XMLNS_PING,
     130                                                   XMLNS_RECEIPTS,
    130131                                                   XMLNS_SI,
    131132                                                   XMLNS_BYTESTREAMS,
  • protocols/jabber/jabber.h

    r4d82e50 r91ae87d  
    227227#define XMLNS_TIME         "urn:xmpp:time"                                       /* XEP-0202 */
    228228#define XMLNS_PING         "urn:xmpp:ping"                                       /* XEP-0199 */
     229#define XMLNS_RECEIPTS     "urn:xmpp:receipts"                                   /* XEP-0184 */
    229230#define XMLNS_VCARD        "vcard-temp"                                          /* XEP-0054 */
    230231#define XMLNS_DELAY        "jabber:x:delay"                                      /* XEP-0091 */
  • protocols/jabber/message.c

    r4d82e50 r91ae87d  
    2929        char *from = xt_find_attr( node, "from" );
    3030        char *type = xt_find_attr( node, "type" );
     31        char *id = xt_find_attr( node, "id" );
    3132        struct xt_node *body = xt_find_node( node->children, "body" ), *c;
     33        struct xt_node *request = xt_find_node( node->children, "request" );
    3234        struct jabber_buddy *bud = NULL;
    3335        char *s, *room = NULL, *reason = NULL;
     
    3537        if( !from )
    3638                return XT_HANDLED; /* Consider this packet corrupted. */
     39
     40        if( request && id )
     41        {
     42                /* Send a message receipt (XEP-0184), looking like this:
     43                 * <message
     44                 *  from='kingrichard@royalty.england.lit/throne'
     45                 *  id='bi29sg183b4v'
     46                 *  to='northumberland@shakespeare.lit/westminster'>
     47                 *  <received xmlns='urn:xmpp:receipts' id='richard2-4.1.247'/>
     48                 * </message> */
     49                struct xt_node *received, *receipt;
     50               
     51                received = xt_new_node( "received", NULL, NULL );
     52                xt_add_attr( received, "xmlns", XMLNS_RECEIPTS );
     53                xt_add_attr( received, "id", id );
     54                receipt = jabber_make_packet( "message", NULL, from, received );
     55
     56                jabber_write_packet( ic, receipt );
     57                xt_free_node( receipt );
     58        }
    3759       
    3860        bud = jabber_buddy_by_jid( ic, from, GET_BUDDY_EXACT );
Note: See TracChangeset for help on using the changeset viewer.