Changeset 7b40f17 for lib


Ignore:
Timestamp:
2014-10-11T02:20:53Z (10 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
46511b3
Parents:
0e35ff6
Message:

Add support for XEP-0203: Delayed delivery (message timestamps)

Very similar to XEP-0091 which is already supported, but was marked as
obsolete, replaced by XEP-0203. The main differences are the tag name
and the timestamp format.

Due to the similarities, both XEPs are still supported.

Location:
lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/xmltree.c

    r0e35ff6 r7b40f17  
    524524}
    525525
     526struct xt_node *xt_find_node_by_attr( struct xt_node *xt, const char *tag, const char *key, const char *value ) {
     527        struct xt_node *c;
     528        char *s;
     529
     530        for( c = xt; ( c = xt_find_node( c, tag ) ); c = c->next )
     531        {
     532                if( ( s = xt_find_attr( c, key ) ) && strcmp( s, value ) == 0 )
     533                {
     534                        return c;
     535                }
     536        }
     537        return NULL;
     538}
     539
     540
    526541/* Strip a few non-printable characters that aren't allowed in XML streams
    527542   (and upset some XMPP servers for example). */
  • lib/xmltree.h

    r0e35ff6 r7b40f17  
    9292struct xt_node *xt_find_path( struct xt_node *node, const char *name );
    9393char *xt_find_attr( struct xt_node *node, const char *key );
     94struct xt_node *xt_find_node_by_attr( struct xt_node *xt, const char *tag, const char *key, const char *value );
    9495
    9596struct xt_node *xt_new_node( char *name, const char *text, struct xt_node *children );
Note: See TracChangeset for help on using the changeset viewer.