diff options
Diffstat (limited to 'libpurple/protocols/jabber/google.c')
-rw-r--r-- | libpurple/protocols/jabber/google.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/libpurple/protocols/jabber/google.c b/libpurple/protocols/jabber/google.c index e588729ad0..0ce297a6c5 100644 --- a/libpurple/protocols/jabber/google.c +++ b/libpurple/protocols/jabber/google.c @@ -1435,7 +1435,7 @@ void google_buddy_node_chat(PurpleBlistNode *node, gpointer data) JabberStream *js; JabberChat *chat; gchar *room; - guint32 tmp, a, b; + gchar *uuid = purple_uuid_random(); g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); @@ -1444,20 +1444,7 @@ void google_buddy_node_chat(PurpleBlistNode *node, gpointer data) g_return_if_fail(gc != NULL); js = purple_connection_get_protocol_data(gc); - /* Generate a version 4 UUID */ - tmp = g_random_int(); - a = 0x4000 | (tmp & 0xFFF); /* 0x4000 to 0x4FFF */ - tmp >>= 12; - b = ((1 << 3) << 12) | (tmp & 0x3FFF); /* 0x8000 to 0xBFFF */ - - tmp = g_random_int(); - room = g_strdup_printf("private-chat-%08x-%04x-%04x-%04x-%04x%08x", - g_random_int(), - tmp & 0xFFFF, - a, - b, - (tmp >> 16) & 0xFFFF, g_random_int()); - + room = g_strdup_printf("private-chat-%s", uuid); chat = jabber_join_chat(js, room, GOOGLE_GROUPCHAT_SERVER, js->user->node, NULL, NULL); if (chat) { @@ -1466,4 +1453,5 @@ void google_buddy_node_chat(PurpleBlistNode *node, gpointer data) } g_free(room); + g_free(uuid); } |