summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/Clist_modern/src/modern_clc.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_clistmenus.cpp25
-rw-r--r--plugins/Clist_modern/src/modern_clistsettings.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_commonprototypes.h2
-rw-r--r--plugins/PluginUpdater/src/DlgUpdate.cpp1
-rw-r--r--src/mir_app/src/newplugins.cpp1
6 files changed, 36 insertions, 1 deletions
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp
index 2e9646681d..4d92425f45 100644
--- a/plugins/Clist_modern/src/modern_clc.cpp
+++ b/plugins/Clist_modern/src/modern_clc.cpp
@@ -1611,6 +1611,10 @@ static int clcHookModulesLoaded(WPARAM, LPARAM)
HookEvent(ME_SMILEYADD_OPTIONSCHANGED, clcHookSmileyAddOptionsChanged);
}
+ // Set initial value for all contacts
+ for (auto &hContact : Contacts())
+ SetRateExtraIcon(hContact, -1, FALSE);
+
CallService(MS_BACKGROUNDCONFIG_REGISTER, (WPARAM)(LPGEN("List background")"/CLC"), 0);
CallService(MS_BACKGROUNDCONFIG_REGISTER, (WPARAM)(LPGEN("Menu background")"/Menu"), 0);
CallService(MS_BACKGROUNDCONFIG_REGISTER, (WPARAM)(LPGEN("Status bar background")"/StatusBar"), 0);
diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp
index 802cad6cd7..deb29d1a92 100644
--- a/plugins/Clist_modern/src/modern_clistmenus.cpp
+++ b/plugins/Clist_modern/src/modern_clistmenus.cpp
@@ -35,6 +35,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define CLUI_FAVSETRATE "CLUI/SetContactRate" //LParam is rate, Wparam is contact handle
#define CLUI_FAVTOGGLESHOWOFFLINE "CLUI/ToggleContactShowOffline"
+static HANDLE hExtraIcon = nullptr;
+
static wchar_t *FAVMENUROOTNAME = LPGENW("&Contact rate");
static wchar_t *rates[] = {
@@ -126,6 +128,27 @@ void UnloadFavoriteContactMenu()
/////////////////////////////////////////////////////////////////////////////////////////
+void SetRateExtraIcon(MCONTACT hContact, int bRate, BOOL clear)
+{
+ if (hContact == NULL)
+ return;
+
+ if (bRate < 0)
+ bRate = db_get_b(hContact, "CList", "Rate", 0);
+
+ const char *icon = nullptr;
+ switch (bRate) {
+ case 1: icon = "Rate2"; break;
+ case 2: icon = "Rate3"; break;
+ case 3: icon = "Rate4"; break;
+ }
+
+ if (icon != nullptr || clear)
+ ExtraIcon_SetIconByName(hExtraIcon, hContact, icon);
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
static INT_PTR CloseAction(WPARAM, LPARAM)
{
g_CluiData.bSTATE = STATE_PREPARETOEXIT; // workaround for avatar service and other wich destroys service on OK_TOEXIT
@@ -139,6 +162,8 @@ int InitCustomMenus(void)
g_plugin.registerIcon(LPGEN("Contact list"), iconList);
+ hExtraIcon = ExtraIcon_RegisterIcolib("contact_rate", LPGEN("Contact rate"), "Rate4");
+
CreateServiceFunction(CLUI_FAVSETRATE, FAV_SetRate);
CreateServiceFunction(CLUI_FAVTOGGLESHOWOFFLINE, FAV_ToggleShowOffline);
HookEvent(ME_CLIST_PREBUILDCONTACTMENU, FAV_OnContactMenuBuild);
diff --git a/plugins/Clist_modern/src/modern_clistsettings.cpp b/plugins/Clist_modern/src/modern_clistsettings.cpp
index c786522386..0f5ea19bb5 100644
--- a/plugins/Clist_modern/src/modern_clistsettings.cpp
+++ b/plugins/Clist_modern/src/modern_clistsettings.cpp
@@ -159,8 +159,10 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam)
if (!strcmp(cws->szModule, "CList")) {
// name is null or (setting is myhandle)
- if (!strcmp(cws->szSetting, "Rate"))
+ if (!strcmp(cws->szSetting, "Rate")) {
+ SetRateExtraIcon(hContact, cws->value.type == DBVT_DELETED ? 0 : cws->value.bVal);
Clist_Broadcast(CLM_AUTOREBUILD, 0, 0);
+ }
else if (!strcmp(cws->szSetting, "NotOnList"))
pdnce->NotOnList = cws->value.bVal;
diff --git a/plugins/Clist_modern/src/modern_commonprototypes.h b/plugins/Clist_modern/src/modern_commonprototypes.h
index 69c0264136..d84b89c2a3 100644
--- a/plugins/Clist_modern/src/modern_commonprototypes.h
+++ b/plugins/Clist_modern/src/modern_commonprototypes.h
@@ -189,6 +189,8 @@ void UnloadAvatarOverlayIcon(); /
void UnLoadContactListModule(); //clistmod.c
void UpdateAllAvatars(ClcData *dat); //cache_func.c
+void SetRateExtraIcon(MCONTACT hContact, int bRate = -1, BOOL clear = TRUE);
+
void ApplyViewMode(const char *Name);
void SaveViewMode(const char *name, const wchar_t *szGroupFilter, const char *szProtoFilter, unsigned dwStatusMask, unsigned dwStickyStatusMask,
unsigned stickies, unsigned options, unsigned operators, unsigned lmdat);
diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp
index a88a14292b..c056d2220e 100644
--- a/plugins/PluginUpdater/src/DlgUpdate.cpp
+++ b/plugins/PluginUpdater/src/DlgUpdate.cpp
@@ -558,6 +558,7 @@ static renameTable[] =
{ L"msvcr100.dll", nullptr },
{ L"mtextcontrol.dll", nullptr },
{ L"openssl.dll", nullptr },
+ { L"rate.dll", nullptr },
{ L"sms.dll", nullptr },
{ L"tlen.dll", nullptr },
{ L"xfire.dll", nullptr },
diff --git a/src/mir_app/src/newplugins.cpp b/src/mir_app/src/newplugins.cpp
index 5c925891ad..0fadf63e72 100644
--- a/src/mir_app/src/newplugins.cpp
+++ b/src/mir_app/src/newplugins.cpp
@@ -132,6 +132,7 @@ static const MUUID pluginBannedList[] =
{ 0x26a9125d, 0x7863, 0x4e01, { 0xaf, 0x0e, 0xd1, 0x4e, 0xf9, 0x5c, 0x50, 0x54 } }, // old Popup.dll
{ 0x69b9443b, 0xdc58, 0x4876, { 0xad, 0x39, 0xe3, 0xf4, 0x18, 0xa1, 0x33, 0xc5 } }, // mTextControl
{ 0x97724af9, 0xf3fb, 0x47d3, { 0xa3, 0xbf, 0xea, 0xa9, 0x35, 0xc7, 0x4e, 0x6d } }, // msn
+ { 0x45230488, 0x977b, 0x405b, { 0x85, 0x6d, 0xea, 0x27, 0x6d, 0x70, 0x83, 0xb7 } }, // Rate
};
bool isPluginBanned(const MUUID &u1)