diff options
author | George Hazan <george.hazan@gmail.com> | 2013-12-27 16:37:09 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-12-27 16:37:09 +0000 |
commit | 6589749057a044ba88dd7334bc8a19c5786a7506 (patch) | |
tree | 72d53d3278964be76d7f6086dbb03ef066fafc19 /src/modules | |
parent | 94b019364ebfd8a55d3bf8dfe562b87d13d31cab (diff) |
fix for EVENTTYPE_ADDED formatting
git-svn-id: http://svn.miranda-ng.org/main/trunk@7392 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/database/dbutils.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/modules/database/dbutils.cpp b/src/modules/database/dbutils.cpp index 430a007ef6..83824c8315 100644 --- a/src/modules/database/dbutils.cpp +++ b/src/modules/database/dbutils.cpp @@ -107,9 +107,9 @@ static INT_PTR DbEventGetText(WPARAM wParam, LPARAM lParam) if (!dbei->pBlob)
return 0;
- // no text for this kind of events
- if (dbei->eventType == EVENTTYPE_AUTHREQUEST) {
- // blob is: uin(DWORD), hContact(DWORD), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ)
+ if (dbei->eventType == EVENTTYPE_AUTHREQUEST || dbei->eventType == EVENTTYPE_ADDED) {
+ // EVENTTYPE_AUTHREQUEST: uin(DWORD), hContact(DWORD), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ)
+ // EVENTTYPE_ADDED: uin(DWORD), hContact(HANDLE), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ)
DWORD uin = *(DWORD*)dbei->pBlob;
HANDLE hContact = (HANDLE)*(DWORD*)(dbei->pBlob + sizeof(DWORD));
char *buf = LPSTR(dbei->pBlob) + sizeof(DWORD)*2;
@@ -117,7 +117,6 @@ static INT_PTR DbEventGetText(WPARAM wParam, LPARAM lParam) ptrT tszFirst(getEventString(dbei, buf));
ptrT tszLast(getEventString(dbei, buf));
ptrT tszEmail(getEventString(dbei, buf));
- ptrT tszReason(getEventString(dbei, buf));
CMString nick, text;
if (tszFirst || tszLast) {
@@ -136,9 +135,14 @@ static INT_PTR DbEventGetText(WPARAM wParam, LPARAM lParam) }
if (!nick.IsEmpty())
nick = _T("(") + nick + _T(")");
-
- text.Format(TranslateT("Authorization request from %s%s: %s"),
- (*tszNick == 0) ? cli.pfnGetContactDisplayName(hContact, 0) : tszNick, nick, tszReason);
+
+ if (dbei->eventType == EVENTTYPE_AUTHREQUEST) {
+ ptrT tszReason(getEventString(dbei, buf));
+ text.Format(TranslateT("Authorization request from %s%s: %s"),
+ (*tszNick == 0) ? cli.pfnGetContactDisplayName(hContact, 0) : tszNick, nick, tszReason);
+ }
+ else text.Format(TranslateT("You were added by %s%s"),
+ (*tszNick == 0) ? cli.pfnGetContactDisplayName(hContact, 0) : tszNick, nick);
return (egt->datatype == DBVT_WCHAR) ? (INT_PTR)mir_tstrdup(text) : (INT_PTR)mir_t2a(text);
}
|