summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/JabberG/src')
-rw-r--r--protocols/JabberG/src/jabber_message_handlers.cpp16
-rwxr-xr-xprotocols/JabberG/src/jabber_util.cpp5
2 files changed, 11 insertions, 10 deletions
diff --git a/protocols/JabberG/src/jabber_message_handlers.cpp b/protocols/JabberG/src/jabber_message_handlers.cpp
index eb00c11636..f0002ddeac 100644
--- a/protocols/JabberG/src/jabber_message_handlers.cpp
+++ b/protocols/JabberG/src/jabber_message_handlers.cpp
@@ -38,14 +38,16 @@ bool CJabberProto::OnMessageError(const TiXmlElement *node, ThreadData*, CJabber
if (id != -1)
ProtoBroadcastAck(pInfo->GetHContact(), ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)id, (LPARAM)szErrText.c_str());
else {
- wchar_t buf[512];
- auto *body = XmlGetChildText(node, "body");
- if (body)
- mir_snwprintf(buf, L"%s:\n%s\n%s", pInfo->GetFrom(), body, szErrText.c_str());
- else
- mir_snwprintf(buf, L"%s:\n%s", pInfo->GetFrom(), szErrText.c_str());
+ CMStringW wszErrorText(Utf2T(pInfo->GetFrom()));
+ wszErrorText.Append(L":\n");
- MsgPopup(0, buf, TranslateT("Error"));
+ if (auto *body = XmlGetChildText(node, "body")) {
+ wszErrorText.Append(Utf2T(body));
+ wszErrorText.AppendChar('\n');
+ }
+
+ wszErrorText += szErrText;
+ MsgPopup(0, wszErrorText, TranslateT("Error"));
}
}
return true;
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp
index 6e69251042..ec09d029ec 100755
--- a/protocols/JabberG/src/jabber_util.cpp
+++ b/protocols/JabberG/src/jabber_util.cpp
@@ -284,10 +284,9 @@ CMStringW JabberErrorMsg(const TiXmlElement *errorNode, int *pErrorCode)
}
}
+ ret.Format(L"%s %d: %s", TranslateT("Error"), errorCode, TranslateW(JabberErrorStr(errorCode)));
if (str != nullptr)
- ret.Format(L"%s %d: %s\r\n%s", TranslateT("Error"), errorCode, TranslateW(JabberErrorStr(errorCode)), Utf2T(str).get());
- else
- ret.Format(L"%s %d: %s", TranslateT("Error"), errorCode, TranslateW(JabberErrorStr(errorCode)));
+ ret.AppendFormat(L"\r\n%s", Utf2T(str).get());
if (pErrorCode)
*pErrorCode = errorCode;