+
+ char dom[1024]; // Pidgin is very picky about where this
+ safestrncpy(dom, XMPP->client_jid, sizeof(dom)); // result stanza is "from" - it wants the
+ if (IsEmptyStr(dom)) { // same domain that the user's jid is in.
+ safestrncpy(dom, XMPP->server_name, sizeof(dom));
+ }
+ char *at = strrchr(dom, '@');
+ if (at) {
+ strcpy(dom, ++at);
+ }
+ char *slash = strchr(dom, '/');
+ if (slash) {
+ *slash = 0;
+ }
+