diff options
author | George Hazan <ghazan@miranda.im> | 2020-03-26 13:01:38 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-03-26 13:01:38 +0300 |
commit | 7b071d9e58a8abbfeac5914153d19b0dffc017c9 (patch) | |
tree | f70aa3a75d21c21a84d5e4f04f4ee9b4079ab075 /plugins/AVS/src/main.cpp | |
parent | 3c4e6bc04580593cd0c83451a99c5bcdcebc2577 (diff) |
AVS: code cleaning
Diffstat (limited to 'plugins/AVS/src/main.cpp')
-rw-r--r-- | plugins/AVS/src/main.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/plugins/AVS/src/main.cpp b/plugins/AVS/src/main.cpp index 3fec92cd3b..6761cdd781 100644 --- a/plugins/AVS/src/main.cpp +++ b/plugins/AVS/src/main.cpp @@ -122,11 +122,10 @@ static int MetaChanged(WPARAM hMeta, LPARAM hSubContact) static void LoadDefaultInfo()
{
- protoPicCacheEntry *pce = new protoPicCacheEntry(PCE_TYPE_GLOBAL);
+ protoPicCacheEntry *pce = new protoPicCacheEntry(PCE_TYPE_GLOBAL, AVS_DEFAULT);
if (CreateAvatarInCache(0, pce, AVS_DEFAULT) != 1)
db_unset(0, PPICT_MODULE, AVS_DEFAULT);
- pce->szProtoname = mir_strdup(AVS_DEFAULT);
g_ProtoPictures.insert(pce);
}
@@ -138,28 +137,25 @@ static void LoadProtoInfo(PROTOCOLDESCRIPTOR *proto) char protoName[MAX_PATH];
mir_snprintf(protoName, "Global avatar for %s accounts", proto->szName);
- protoPicCacheEntry *pce = new protoPicCacheEntry(PCE_TYPE_PROTO);
+ protoPicCacheEntry *pce = new protoPicCacheEntry(PCE_TYPE_PROTO, protoName);
if (CreateAvatarInCache(0, pce, protoName) != 1)
db_unset(0, PPICT_MODULE, protoName);
pce->pd = proto;
- pce->szProtoname = mir_strdup(protoName);
g_ProtoPictures.insert(pce);
}
static void LoadAccountInfo(PROTOACCOUNT *acc)
{
- protoPicCacheEntry *pce = new protoPicCacheEntry(PCE_TYPE_ACCOUNT);
+ protoPicCacheEntry *pce = new protoPicCacheEntry(PCE_TYPE_ACCOUNT, acc->szModuleName);
if (CreateAvatarInCache(0, pce, acc->szModuleName) != 1)
db_unset(0, PPICT_MODULE, acc->szModuleName);
pce->pa = acc;
- pce->szProtoname = mir_strdup(acc->szModuleName);
g_ProtoPictures.insert(pce);
- pce = new protoPicCacheEntry(PCE_TYPE_ACCOUNT);
+ pce = new protoPicCacheEntry(PCE_TYPE_ACCOUNT, acc->szModuleName);
CreateAvatarInCache(INVALID_CONTACT_ID, pce, acc->szModuleName);
- pce->szProtoname = mir_strdup(acc->szModuleName);
g_MyAvatars.insert(pce);
}
@@ -340,9 +336,8 @@ static int ModulesLoaded(WPARAM, LPARAM) LoadAccountInfo(it);
// Load global avatar
- protoPicCacheEntry *pce = new protoPicCacheEntry(PCE_TYPE_GLOBAL);
+ protoPicCacheEntry *pce = new protoPicCacheEntry(PCE_TYPE_GLOBAL, "");
CreateAvatarInCache(INVALID_CONTACT_ID, pce, "");
- pce->szProtoname = mir_strdup("");
g_MyAvatars.insert(pce);
HookEvent(ME_PROTO_ACCLISTCHANGED, OnAccChanged);
|