# HG changeset patch # User Sean Egan # Date 1035142848 0 # Node ID 303e40b66b9670b81356f67d919010745bdc1f51 # Parent f53370197bb9a9beb05ff38e3f2c538752b8eb3d [gaim-migrate @ 3908] Another patch by faceprint--and I don't even know what this one does. committer: Tailor Script diff -r f53370197bb9 -r 303e40b66b96 src/protocols/jabber/jabber.c --- a/src/protocols/jabber/jabber.c Sun Oct 20 19:38:36 2002 +0000 +++ b/src/protocols/jabber/jabber.c Sun Oct 20 19:40:48 2002 +0000 @@ -1226,7 +1226,11 @@ if(jri->thread_id) ct = g_strdup(jri->thread_id); } - + if(!ct) { + char buf[1024]; + snprintf(buf, sizeof(buf), "%s%d", name, (int)time(NULL)); + ct = g_strdup(shahash(buf)); + } return ct; } @@ -1268,9 +1272,11 @@ char m[BUF_LONG * 2]; type = xmlnode_get_attrib(p->x, "type"); - + if ((y = xmlnode_get_tag(p->x, "thread"))) thread_id = xmlnode_get_data(y); + if(!thread_id) + thread_id = ""; y = xmlnode_get_firstchild(p->x); @@ -1321,16 +1327,14 @@ time_sent); else { int flags = 0; - jab_res_info jri = jabber_find_resource(GJ_GC(gjc), jid_full(p->from)); + jab_res_info jri = jabber_find_resource(GJ_GC(gjc), from); if(jri && typing) jri->has_composing = TRUE; if (xmlnode_get_tag(p->x, "gaim")) flags = IM_FLAG_GAIMUSER; - if ((y = xmlnode_get_tag(p->x, "thread"))) - jabber_track_convo_thread(gjc, jid_full(p->from), - xmlnode_get_data(y)); - if (find_conversation(jid_full(p->from))) - serv_got_im(GJ_GC(gjc), jid_full(p->from), m, flags, + jabber_track_convo_thread(gjc, from, thread_id); + if (find_conversation(from)) + serv_got_im(GJ_GC(gjc), from, m, flags, time_sent, -1); else { if(p->from->user) { @@ -2448,12 +2452,14 @@ x = xmlnode_new_tag("message"); xmlnode_put_attrib(x, "to", realwho); - + thread_id = jabber_get_convo_thread(gjc, realwho); if(thread_id) { - y = xmlnode_insert_tag(x, "thread"); - xmlnode_insert_cdata(y, thread_id, -1); + if(strcmp(thread_id, "")) { + y = xmlnode_insert_tag(x, "thread"); + xmlnode_insert_cdata(y, thread_id, -1); + } g_free(thread_id); }