Ignore:
Timestamp:
2006-10-07T13:01:02Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
36e9f62
Parents:
101d84f
Message:

Never mind about those privacy lists, they're horrible and not supported
by any client I know of. Also, they're already working on a (probably
completely incompatible) standard: JEP-191. Maybe BitlBee will implement
it too some day...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/xmltree.c

    r101d84f r090f1cb  
    528528        int i;
    529529       
    530         for( i = 0; node->attr[i].key; i ++ );
    531         node->attr = g_renew( struct xt_attr, node->attr, i + 2 );
    532         node->attr[i].key = g_strdup( key );
     530        /* Now actually it'd be nice if we can also change existing attributes
     531           (which actually means this function doesn't have the right name).
     532           So let's find out if we have this attribute already... */
     533        for( i = 0; node->attr[i].key; i ++ )
     534                if( strcmp( node->attr[i].key, key ) == 0 )
     535                        break;
     536       
     537        if( node->attr[i].key == NULL )
     538        {
     539                /* If not, allocate space for a new attribute. */
     540                node->attr = g_renew( struct xt_attr, node->attr, i + 2 );
     541                node->attr[i].key = g_strdup( key );
     542                node->attr[i+1].key = NULL;
     543        }
     544        else
     545        {
     546                /* Otherwise, free the old value before setting the new one. */
     547                g_free( node->attr[i].value );
     548        }
     549       
    533550        node->attr[i].value = g_strdup( value );
    534         node->attr[i+1].key = NULL;
    535 }
     551}
Note: See TracChangeset for help on using the changeset viewer.