diff options
author | (no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> | 2010-09-18 22:18:27 +0000 |
---|---|---|
committer | (no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> | 2010-09-18 22:18:27 +0000 |
commit | 3c9bb62a51cfcbd9a4a7dcf6a8e29657c6ee1ad2 (patch) | |
tree | 6d9bf0b4ceb2cf06b8c2a037485277253cbcb7a0 | |
parent | 89c31c8a1ea2d6d0ab609e47768fc8ab5cff1f0d (diff) |
Added ability to display contact time in tooltips
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@535 4f64403b-2f21-0410-a795-97e2b3489a10
-rw-r--r-- | tipper/common.h | 1 | ||||
-rw-r--r-- | tipper/options.cpp | 9 | ||||
-rw-r--r-- | tipper/subst.cpp | 3 | ||||
-rw-r--r-- | tipper/tipper.cpp | 8 |
4 files changed, 17 insertions, 4 deletions
diff --git a/tipper/common.h b/tipper/common.h index 7bdb607..f98fbb8 100644 --- a/tipper/common.h +++ b/tipper/common.h @@ -55,6 +55,7 @@ #include <m_protosvc.h>
#include <m_protomod.h>
#include <m_contacts.h>
+#include <m_timezones.h>
#include <m_popup.h>
#include <m_fontservice.h>
diff --git a/tipper/options.cpp b/tipper/options.cpp index 21bc6d6..05b6e0a 100644 --- a/tipper/options.cpp +++ b/tipper/options.cpp @@ -50,6 +50,15 @@ void CreateDefaultItems() { options.di_list = di_node;
options.di_count++;
+ // Contact time
+ di_node = (DIListNode *)malloc(sizeof(DIListNode));
+ _tcsncpy(di_node->di.label, _T("Time:"), LABEL_LEN);
+ _tcsncpy(di_node->di.value, _T("%sys:time%"), VALUE_LEN);
+ di_node->di.line_above = di_node->di.value_newline = false;
+ di_node->next = options.di_list;
+ options.di_list = di_node;
+ options.di_count++;
+
// client substitution
ds_node = (DSListNode *)malloc(sizeof(DSListNode));
_tcsncpy(ds_node->ds.name, _T("client"), LABEL_LEN);
diff --git a/tipper/subst.cpp b/tipper/subst.cpp index 2980c5c..cd10998 100644 --- a/tipper/subst.cpp +++ b/tipper/subst.cpp @@ -204,6 +204,9 @@ bool GetSysSubstText(HANDLE hContact, TCHAR *raw_spec, TCHAR *buff, int bufflen) _tcsncpy(buff, pa->tszAccountName, bufflen);
return true;
}
+ } else if (!_tcscmp(raw_spec, _T("time"))) {
+ if (tmi.printDateTime && !tmi.printDateTimeByContact(hContact, _T("t"), buff, bufflen, TZF_KNOWNONLY))
+ return true;
} else if (!_tcscmp(raw_spec, _T("uidname"))) {
char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
return uid_name(szProto, buff, bufflen);
diff --git a/tipper/tipper.cpp b/tipper/tipper.cpp index cfa08e9..6a8600a 100644 --- a/tipper/tipper.cpp +++ b/tipper/tipper.cpp @@ -26,7 +26,8 @@ HANDLE hAvChangeEvent = 0, hAvContactChangeEvent = 0, hShowTipEvent = 0, hHideTi HANDLE hShowTipService = 0, hShowTipWService = 0, hHideTipService = 0;
-struct MM_INTERFACE memoryManagerInterface = {0};
+MM_INTERFACE mmi;
+TIME_API tmi;
PLUGININFOEX pluginInfo={
sizeof(PLUGININFOEX),
@@ -403,9 +404,8 @@ extern "C" int TIPPER_API Load(PLUGINLINK *link) { char szVer[128];
unicode_system = (CallService(MS_SYSTEM_GETVERSIONTEXT, (WPARAM)sizeof(szVer), (LPARAM)szVer) == 0 && strstr(szVer, "Unicode"));
- // get the internal malloc/free()
- memoryManagerInterface.cbSize = sizeof(memoryManagerInterface);
- CallService(MS_SYSTEM_GET_MMI, 0, (LPARAM)&memoryManagerInterface);
+ mir_getMMI(&mmi);
+ mir_getTMI(&tmi);
// don't save status messages
CallService(MS_DB_SETSETTINGRESIDENT, (WPARAM)TRUE, (LPARAM)MODULE "/TempStatusMsg");
|