diff options
author | Mataes <mataes2007@gmail.com> | 2020-04-03 22:17:15 +0300 |
---|---|---|
committer | Mataes <mataes2007@gmail.com> | 2020-04-03 22:17:15 +0300 |
commit | 10f5bee2b90811b4fe4d94284c506b8b56eff21c (patch) | |
tree | cbe30a2c38387a7ff61e8088499f3d3d0128b4fd /plugins/NewStory/src/templates.cpp | |
parent | 8f771fea4309df8b0b3d4cb98bfb4c95e32b5b52 (diff) |
Newstory: minor cleanup
Diffstat (limited to 'plugins/NewStory/src/templates.cpp')
-rw-r--r-- | plugins/NewStory/src/templates.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/NewStory/src/templates.cpp b/plugins/NewStory/src/templates.cpp index a0bfb85259..2c5ef19d76 100644 --- a/plugins/NewStory/src/templates.cpp +++ b/plugins/NewStory/src/templates.cpp @@ -255,13 +255,17 @@ void vfEvent(int, TemplateVars *vars, MCONTACT, HistoryArray::ItemData *item) { HICON hIcon; TCHAR *s; + wchar_t* nick; // %U: UIN (contextual, own uin for sent, buddys UIN for received messages) // %N: Nickname - char* proto = Proto_GetBaseAccountName(item->hContact); - wchar_t *buff = Contact_GetInfo(CNF_NICK, item->dbe.flags & DBEF_SENT ? 0 : (WPARAM)item->hContact, proto); - TplSetVar(vars, 'N', buff, false); + if (item->dbe.flags & DBEF_SENT) { + char* proto = Proto_GetBaseAccountName(item->hContact); + nick = Contact_GetInfo(CNF_DISPLAY, 0, proto); + } else + nick = Clist_GetContactDisplayName(item->hContact, 0); + TplSetVar(vars, 'N', nick, false); // %I: Icon switch (item->dbe.eventType) { |