From 13c033c257f6c083b0c46b4fa28601db5a0b6335 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 27 Feb 2014 20:50:07 +0000 Subject: MS_MC_GETMETACONTACT => db_mc_getMeta git-svn-id: http://svn.miranda-ng.org/main/trunk@8317 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/AvatarHistory/src/AvatarHistory.cpp | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) (limited to 'plugins/AvatarHistory') diff --git a/plugins/AvatarHistory/src/AvatarHistory.cpp b/plugins/AvatarHistory/src/AvatarHistory.cpp index d56a2a20cf..ae493d33ad 100644 --- a/plugins/AvatarHistory/src/AvatarHistory.cpp +++ b/plugins/AvatarHistory/src/AvatarHistory.cpp @@ -156,18 +156,15 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) else ShowDebugPopup(hContact, TranslateT("AVH Debug: File copied successfully"), history_filename); - if (ServiceExists(MS_MC_GETMETACONTACT)) { - MCONTACT hMetaContact = (MCONTACT)CallService(MS_MC_GETMETACONTACT, hContact, 0); - - if (hMetaContact != NULL && ContactEnabled(hMetaContact, "LogToDisk", AVH_DEF_LOGTOHISTORY)) { - TCHAR filename[MAX_PATH] = _T(""); - - GetOldStyleAvatarName(filename, hMetaContact); - if (CopyImageFile(avatar->filename, filename)) - ShowPopup(hContact, TranslateT("Avatar History: Unable to save avatar"), filename); - else - ShowDebugPopup(hContact, TranslateT("AVH Debug: File copied successfully"), filename); - } + MCONTACT hMetaContact = db_mc_getMeta(hContact); + if (hMetaContact && ContactEnabled(hMetaContact, "LogToDisk", AVH_DEF_LOGTOHISTORY)) { + TCHAR filename[MAX_PATH] = _T(""); + + GetOldStyleAvatarName(filename, hMetaContact); + if (CopyImageFile(avatar->filename, filename)) + ShowPopup(hContact, TranslateT("Avatar History: Unable to save avatar"), filename); + else + ShowDebugPopup(hContact, TranslateT("AVH Debug: File copied successfully"), filename); } } } @@ -201,11 +198,9 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) if (opts.log_per_contact_folders) { CreateOldStyleShortcut(hContact, history_filename); - if (ServiceExists(MS_MC_GETMETACONTACT)) { - MCONTACT hMetaContact = (MCONTACT)CallService(MS_MC_GETMETACONTACT, hContact, 0); - if (hMetaContact != NULL && ContactEnabled(hMetaContact, "LogToDisk", AVH_DEF_LOGTOHISTORY)) - CreateOldStyleShortcut(hMetaContact, history_filename); - } + MCONTACT hMetaContact = db_mc_getMeta(hContact); + if (hMetaContact && ContactEnabled(hMetaContact, "LogToDisk", AVH_DEF_LOGTOHISTORY)) + CreateOldStyleShortcut(hMetaContact, history_filename); } } } -- cgit v1.2.3