diff options
Diffstat (limited to 'protocols/JabberG/src/jabber_proto.cpp')
-rw-r--r-- | protocols/JabberG/src/jabber_proto.cpp | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index c0b8d4b93c..993e0faf2f 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -441,23 +441,13 @@ int CJabberProto::AuthDeny(MEVENT hDbEvent, const wchar_t*) debugLogA("Entering AuthDeny");
DB::EventInfo dbei(hDbEvent);
- if (!dbei)
- return 1;
-
- if (dbei.eventType != EVENTTYPE_AUTHREQUEST)
+ if (!dbei || dbei.eventType != EVENTTYPE_AUTHREQUEST || mir_strcmp(dbei.szModule, m_szModuleName))
return 1;
- if (mir_strcmp(dbei.szModule, m_szModuleName))
- return 1;
-
- char *nick = (char*)(dbei.pBlob + sizeof(uint32_t) * 2);
- char *firstName = nick + mir_strlen(nick) + 1;
- char *lastName = firstName + mir_strlen(firstName) + 1;
- char *jid = lastName + mir_strlen(lastName) + 1;
-
- debugLogA("Send 'authorization denied' to %s", jid);
+ DB::AUTH_BLOB auth(dbei.pBlob);
+ debugLogA("Send 'authorization denied' to %s", auth.get_email());
- ptrA newJid(dbei.flags & DBEF_UTF ? mir_strdup(jid) : mir_utf8encode(jid));
+ ptrA newJid(dbei.flags & DBEF_UTF ? mir_strdup(auth.get_email()) : mir_utf8encode(auth.get_email()));
m_ThreadInfo->send(XmlNode("presence") << XATTR("to", newJid) << XATTR("type", "unsubscribed"));
return 0;
}
|