summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/NewXstatusNotify/src/common.h2
-rw-r--r--plugins/NewXstatusNotify/src/popup.cpp15
2 files changed, 7 insertions, 10 deletions
diff --git a/plugins/NewXstatusNotify/src/common.h b/plugins/NewXstatusNotify/src/common.h
index d19761c135..77af3b76f0 100644
--- a/plugins/NewXstatusNotify/src/common.h
+++ b/plugins/NewXstatusNotify/src/common.h
@@ -25,7 +25,6 @@
#pragma once
#define STRICT
-#define WIN32_LEAN_AND_MEAN
#define _CRT_SECURE_NO_WARNINGS
#define _WIN32_WINNT 0x0500
@@ -57,6 +56,7 @@
#include <m_userinfo.h>
#include <m_xstatus.h>
#include <m_extraicons.h>
+#include <m_string.h>
#include <m_metacontacts.h>
#include <m_toptoolbar.h>
diff --git a/plugins/NewXstatusNotify/src/popup.cpp b/plugins/NewXstatusNotify/src/popup.cpp
index 13e13d4d08..f57710a6ee 100644
--- a/plugins/NewXstatusNotify/src/popup.cpp
+++ b/plugins/NewXstatusNotify/src/popup.cpp
@@ -25,19 +25,16 @@ void ShowChangePopup(MCONTACT hContact, HICON hIcon, WORD newStatus, TCHAR *stzT
{
POPUPDATAT ppd = { 0 };
ppd.lchContact = hContact;
- ppd.lchIcon = hIcon;//LoadSkinnedProtoIcon(szProto, iconStatus);
- _tcsncpy(ppd.lptzContactName, (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GSMDF_TCHAR), MAX_CONTACTNAME);
+ ppd.lchIcon = hIcon;
+ CMString buf((TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GSMDF_TCHAR));
// add group name to popup title
if (opt.ShowGroup) {
- DBVARIANT dbv;
- if (!db_get_ts(hContact, "CList", "Group", &dbv)) {
- _tcsncat(ppd.lptzContactName, _T(" ("), MAX_CONTACTNAME);
- _tcsncat(ppd.lptzContactName, dbv.ptszVal, MAX_CONTACTNAME);
- _tcsncat(ppd.lptzContactName, _T(")"), MAX_CONTACTNAME);
- db_free(&dbv);
- }
+ ptrT tszGroup(db_get_tsa(hContact, "CList", "Group"));
+ if (tszGroup)
+ buf.AppendFormat(_T(" (%s)"), tszGroup);
}
+ _tcsncpy_s(ppd.lptzContactName, buf, _TRUNCATE);
_tcsncpy(ppd.lptzText, stzText, MAX_SECONDLINE);