summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tipper/common.h1
-rw-r--r--tipper/options.cpp9
-rw-r--r--tipper/subst.cpp3
-rw-r--r--tipper/tipper.cpp8
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");