From 4ffc9c6cfb60f8e4f83dc27224cbbcf121800b82 Mon Sep 17 00:00:00 2001 From: ElzorFox Date: Fri, 18 Jan 2019 13:10:11 +0500 Subject: Clist_modern: add 'Last Seen' support to status text version bump --- plugins/Clist_modern/src/modern_cachefuncs.cpp | 12 ++++++++++++ plugins/Clist_modern/src/stdafx.h | 1 + plugins/Clist_modern/src/version.h | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp index 46b4e95d48..0259ab7c8a 100644 --- a/plugins/Clist_modern/src/modern_cachefuncs.cpp +++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp @@ -354,12 +354,24 @@ int GetStatusMessage(wchar_t *text, int text_size, ClcCacheEntry *pdnce, BOOL xs // Get StatusMsg if (pdnce->hContact && text[0] == '\0') { + if (noAwayMsg && ServiceExists(MS_LASTSEEN_GET)) { + ptrW pwszLastSeen((LPWSTR)CallService(MS_LASTSEEN_GET, (WPARAM)pdnce->hContact)); + if (pwszLastSeen) { + CMStringW wszLastSeen(Translate("Last seen: ")); + wszLastSeen.AppendFormat(L"%s", pwszLastSeen); + CopySkipUnprintableChars(text, (wchar_t*)wszLastSeen.c_str(), text_size - 1); + if (text[0] != '\0') + return 1; + } + } + ptrW tszStatusMsg(g_plugin.getWStringA(pdnce->hContact, "StatusMsg")); if (tszStatusMsg != nullptr) { CopySkipUnprintableChars(text, tszStatusMsg, text_size - 1); if (text[0] != '\0') return 1; } + } // Get XStatusMsg diff --git a/plugins/Clist_modern/src/stdafx.h b/plugins/Clist_modern/src/stdafx.h index bc4ab56896..1fe3af4871 100644 --- a/plugins/Clist_modern/src/stdafx.h +++ b/plugins/Clist_modern/src/stdafx.h @@ -101,6 +101,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include +#include struct CMPlugin : public PLUGIN { diff --git a/plugins/Clist_modern/src/version.h b/plugins/Clist_modern/src/version.h index 4d7628f1f1..eb8012bac7 100644 --- a/plugins/Clist_modern/src/version.h +++ b/plugins/Clist_modern/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0 #define __MINOR_VERSION 9 #define __RELEASE_NUM 1 -#define __BUILD_NUM 7 +#define __BUILD_NUM 8 #include -- cgit v1.2.3