diff options
author | George Hazan <george.hazan@gmail.com> | 2013-12-19 20:37:25 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-12-19 20:37:25 +0000 |
commit | 8b8a98c49ef56525d35f0482a7b43377ebb80529 (patch) | |
tree | d53c8d55409b1716bcae53bc2e973412198550aa | |
parent | fa906d9bf4baec75ba72bed046d3fb5f794206a8 (diff) |
core processing of EVENTTYPE_CONTACTS
git-svn-id: http://svn.miranda-ng.org/main/trunk@7290 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | src/modules/database/dbutils.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/modules/database/dbutils.cpp b/src/modules/database/dbutils.cpp index 5f2480c08c..e218b7f436 100644 --- a/src/modules/database/dbutils.cpp +++ b/src/modules/database/dbutils.cpp @@ -141,7 +141,23 @@ static INT_PTR DbEventGetText(WPARAM wParam, LPARAM lParam) (*tszNick == 0) ? cli.pfnGetContactDisplayName(hContact, 0) : tszNick, nick, tszReason);
return (egt->datatype == DBVT_WCHAR) ? (INT_PTR)mir_tstrdup(text) : (INT_PTR)mir_t2a(text);
}
- else if (dbei->eventType == EVENTTYPE_FILE) {
+
+ if (dbei->eventType == EVENTTYPE_CONTACTS) {
+ CMString text(TranslateT("Contacts: "));
+ // blob is: [uin(ASCIIZ), nick(ASCIIZ)]*
+ char *buf = LPSTR(dbei->pBlob), *limit = LPSTR(dbei->pBlob) + dbei->cbBlob;
+ while (buf < limit) {
+ ptrT tszUin(getEventString(dbei, buf));
+ ptrT tszNick(getEventString(dbei, buf));
+ if (tszNick)
+ text.AppendFormat(_T("\"%s\" "), tszNick);
+ if (tszUin)
+ text.AppendFormat(_T("<%s>; "), tszUin);
+ }
+ return (egt->datatype == DBVT_WCHAR) ? (INT_PTR)mir_tstrdup(text) : (INT_PTR)mir_t2a(text);
+ }
+
+ if (dbei->eventType == EVENTTYPE_FILE) {
char *buf = LPSTR(dbei->pBlob) + sizeof(DWORD);
ptrT tszFileName(getEventString(dbei, buf));
ptrT tszDescription(getEventString(dbei, buf));
|