diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/FingerprintNG/fingerprint_ng_12.vcxproj | 1 | ||||
-rw-r--r-- | plugins/FingerprintNG/fingerprint_ng_12.vcxproj.filters | 3 | ||||
-rw-r--r-- | plugins/FingerprintNG/src/fingerprint.cpp | 32 | ||||
-rw-r--r-- | plugins/FingerprintNG/src/global.h | 1 |
4 files changed, 25 insertions, 12 deletions
diff --git a/plugins/FingerprintNG/fingerprint_ng_12.vcxproj b/plugins/FingerprintNG/fingerprint_ng_12.vcxproj index 484c976993..6e91fc240c 100644 --- a/plugins/FingerprintNG/fingerprint_ng_12.vcxproj +++ b/plugins/FingerprintNG/fingerprint_ng_12.vcxproj @@ -195,7 +195,6 @@ <ClCompile Include="src\masks.cpp" />
<ClCompile Include="src\options.cpp" />
<ClCompile Include="src\main.cpp" />
- <ClCompile Include="src\utilities.cpp" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res\resource.rc" />
diff --git a/plugins/FingerprintNG/fingerprint_ng_12.vcxproj.filters b/plugins/FingerprintNG/fingerprint_ng_12.vcxproj.filters index 62387364f4..7b30f41640 100644 --- a/plugins/FingerprintNG/fingerprint_ng_12.vcxproj.filters +++ b/plugins/FingerprintNG/fingerprint_ng_12.vcxproj.filters @@ -29,9 +29,6 @@ <ClCompile Include="src\fingerprint.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="src\utilities.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="src\main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
diff --git a/plugins/FingerprintNG/src/fingerprint.cpp b/plugins/FingerprintNG/src/fingerprint.cpp index 304d445002..c2a3b44f84 100644 --- a/plugins/FingerprintNG/src/fingerprint.cpp +++ b/plugins/FingerprintNG/src/fingerprint.cpp @@ -841,16 +841,31 @@ int OnExtraImageApply(WPARAM hContact, LPARAM lParam) if (hContact == NULL)
return 0;
+ ptrT tszMirver;
char *szProto = GetContactProto(hContact);
- if (szProto != NULL) {
- DBVARIANT dbvMirVer;
- if ( !db_get_ts(hContact, szProto, "MirVer", &dbvMirVer)) {
- ApplyFingerprintImage(hContact, dbvMirVer.ptszVal);
- db_free(&dbvMirVer);
+ if (szProto != NULL)
+ tszMirver = db_get_tsa(hContact, szProto, "MirVer");
+
+ ApplyFingerprintImage(hContact, tszMirver);
+ return 0;
+}
+
+/****************************************************************************************
+* OnMetaDefaultChanged
+* update MC icon according to its default contact
+*/
+
+static int OnMetaDefaultChanged(WPARAM hMeta, LPARAM hSub)
+{
+ if (hSub != NULL) {
+ char *szProto = GetContactProto(hSub);
+ if (szProto != NULL) {
+ ptrT tszMirver(db_get_tsa(hSub, szProto, "MirVer"));
+ if (tszMirver)
+ db_set_ts(hMeta, META_PROTO, "MirVer", tszMirver);
}
- else ApplyFingerprintImage(hContact, NULL);
}
- else ApplyFingerprintImage(hContact, NULL);
+
return 0;
}
@@ -864,7 +879,7 @@ static int OnContactSettingChanged(WPARAM hContact, LPARAM lParam) if (hContact == NULL)
return 0;
- DBCONTACTWRITESETTING* cws = (DBCONTACTWRITESETTING*)lParam;
+ DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
if (cws && cws->szSetting && !strcmp(cws->szSetting, "MirVer")) {
switch (cws->value.type) {
case DBVT_UTF8:
@@ -947,6 +962,7 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) void InitFingerModule()
{
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
+ HookEvent(ME_MC_DEFAULTTCHANGED, OnMetaDefaultChanged);
CreateServiceFunction(MS_FP_SAMECLIENTSW, ServiceSameClientsW);
CreateServiceFunction(MS_FP_GETCLIENTDESCRW, ServiceGetClientDescrW);
diff --git a/plugins/FingerprintNG/src/global.h b/plugins/FingerprintNG/src/global.h index 64fa08b66c..19a7b22903 100644 --- a/plugins/FingerprintNG/src/global.h +++ b/plugins/FingerprintNG/src/global.h @@ -53,6 +53,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_userinfo.h>
#include <m_extraicons.h>
#include <m_message.h>
+#include <m_metacontacts.h>
#include <m_fingerprint.h>
|