Changeset 1444be5 for protocols/jabber
- Timestamp:
- 2012-10-17T07:23:00Z (12 years ago)
- Branches:
- master
- Children:
- 91ae87d
- Parents:
- 13df515
- Location:
- protocols/jabber
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/iq.c
r13df515 r1444be5 128 128 XMLNS_MUC, 129 129 XMLNS_PING, 130 XMLNS_RECEIPTS, 130 131 XMLNS_SI, 131 132 XMLNS_BYTESTREAMS, -
protocols/jabber/jabber.h
r13df515 r1444be5 227 227 #define XMLNS_TIME "urn:xmpp:time" /* XEP-0202 */ 228 228 #define XMLNS_PING "urn:xmpp:ping" /* XEP-0199 */ 229 #define XMLNS_RECEIPTS "urn:xmpp:receipts" /* XEP-0184 */ 229 230 #define XMLNS_VCARD "vcard-temp" /* XEP-0054 */ 230 231 #define XMLNS_DELAY "jabber:x:delay" /* XEP-0091 */ -
protocols/jabber/message.c
r13df515 r1444be5 24 24 #include "jabber.h" 25 25 26 static unsigned int next_receipt_id = 1; 27 26 28 xt_status jabber_pkt_message( struct xt_node *node, gpointer data ) 27 29 { 28 30 struct im_connection *ic = data; 31 struct jabber_data *jd = ic->proto_data; 29 32 char *from = xt_find_attr( node, "from" ); 30 33 char *type = xt_find_attr( node, "type" ); 34 char *id = xt_find_attr( node, "id" ); 31 35 struct xt_node *body = xt_find_node( node->children, "body" ), *c; 36 struct xt_node *request = xt_find_node( node->children, "request" ); 37 struct xt_node *received, *receipt; 32 38 struct jabber_buddy *bud = NULL; 33 39 char *s, *room = NULL, *reason = NULL; … … 35 41 if( !from ) 36 42 return XT_HANDLED; /* Consider this packet corrupted. */ 43 44 if( request && id ) 45 { 46 /* Send a message receipt (XEP-0184), looking like this: 47 * <message 48 * from='kingrichard@royalty.england.lit/throne' 49 * id='bi29sg183b4v' 50 * to='northumberland@shakespeare.lit/westminster'> 51 * <received xmlns='urn:xmpp:receipts' id='richard2-4.1.247'/> 52 * </message> */ 53 received = xt_new_node( "received", NULL, NULL ); 54 xt_add_attr( received, "xmlns", XMLNS_RECEIPTS ); 55 xt_add_attr( received, "id", id ); 56 receipt = jabber_make_packet( "message", NULL, from, received ); 57 xt_add_attr( receipt, "from", jd->me ); 58 59 char *id = g_strdup_printf( "%sRCPT%05x", JABBER_PACKET_ID, ( next_receipt_id++ ) & 0xfffff ); 60 xt_add_attr( receipt, "id", id ); 61 g_free( id ); 62 63 jabber_write_packet( ic, receipt ); 64 xt_free_node( receipt ); 65 } 37 66 38 67 bud = jabber_buddy_by_jid( ic, from, GET_BUDDY_EXACT );
Note: See TracChangeset
for help on using the changeset viewer.