# HG changeset patch # User Eric Warmenhoven # Date 977237322 0 # Node ID d5069ad0b6b1e0a999d7f8fad5faeadddc452530 # Parent 7f7e3bfb1af77f87f415b9c3bd34f3bc2b24bcfa [gaim-migrate @ 1326] getting it to look pretty. this is probably bad, but eh. committer: Tailor Script diff -r 7f7e3bfb1af7 -r d5069ad0b6b1 plugins/jabber/jabber.c --- a/plugins/jabber/jabber.c Tue Dec 19 14:31:15 2000 +0000 +++ b/plugins/jabber/jabber.c Tue Dec 19 14:48:42 2000 +0000 @@ -413,6 +413,7 @@ static void jabber_handlemessage(gjconn j, jpacket p) { xmlnode y; + char *x, *m; char *from = NULL, *msg = NULL; @@ -425,6 +426,17 @@ return; } + x = strchr(from, '@'); + if (x) { + *x++ = '\0'; + m = strchr(x, '/'); + *m = '\0'; + if (strcmp(j->user->server, x)) { + x--; + *x = '@'; + *m = '/'; + } + } debug_printf("jabber: msg from %s: %s\n", from, msg); serv_got_im(GJ_GC(j), from, msg, 0); @@ -641,12 +653,19 @@ static void jabber_send_im(struct gaim_connection *gc, char *who, char *message, int away) { xmlnode x, y; + char *realwho; + gjconn j = ((struct jabber_data *)gc->proto_data)->jc; if (!who || !message) return; x = xmlnode_new_tag("message"); - xmlnode_put_attrib(x, "to", who); + if (!strchr(who, '@')) + realwho = g_strdup_printf("%s@%s", who, j->user->server); + else + realwho = g_strdup(who); + xmlnode_put_attrib(x, "to", realwho); + g_free(realwho); xmlnode_put_attrib(x, "type", "chat");