aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/jabber/jabber_util.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2007-11-24 18:02:39 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2007-11-24 18:02:39 +0000
commit608f8cf652d0c443ef551ac979bd46096b361663 (patch)
tree574b4f76205e60a837656d02cb517fdf46f752af /protocols/jabber/jabber_util.c
parent3a80471931642374f323e284ce3a5a04b5635a96 (diff)
Added some random hash to the id= for cached XMPP packets so that packets
from other BitlBees won't be picked up accidentally. Might also want to randomize the per-packet IDs because they're still predictable.
Diffstat (limited to 'protocols/jabber/jabber_util.c')
-rw-r--r--protocols/jabber/jabber_util.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/protocols/jabber/jabber_util.c b/protocols/jabber/jabber_util.c
index 56491c4f..43b91fe3 100644
--- a/protocols/jabber/jabber_util.c
+++ b/protocols/jabber/jabber_util.c
@@ -132,9 +132,10 @@ struct xt_node *jabber_make_error_packet( struct xt_node *orig, char *err_cond,
void jabber_cache_add( struct im_connection *ic, struct xt_node *node, jabber_cache_event func )
{
struct jabber_data *jd = ic->proto_data;
- char *id = g_strdup_printf( "%s%05x", JABBER_CACHED_ID, ( next_id++ ) & 0xfffff );
struct jabber_cache_entry *entry = g_new0( struct jabber_cache_entry, 1 );
+ char *id;
+ id = g_strdup_printf( "%s%05x", jd->cached_id_prefix, ( next_id++ ) & 0xfffff );
xt_add_attr( node, "id", id );
g_free( id );