diff options
Diffstat (limited to 'plugins')
166 files changed, 398 insertions, 402 deletions
diff --git a/plugins/AVS/src/acc.cpp b/plugins/AVS/src/acc.cpp index 5d8b10599c..2deea91155 100644 --- a/plugins/AVS/src/acc.cpp +++ b/plugins/AVS/src/acc.cpp @@ -418,7 +418,7 @@ static LRESULT CALLBACK ACCWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP DestroyAnimation(data);
data->hContact = lParam;
- mir_strncpy(data->proto, GetContactProto(data->hContact), sizeof(data->proto));
+ mir_strncpy(data->proto, Proto_GetBaseAccountName(data->hContact), sizeof(data->proto));
StartAnimation(data);
diff --git a/plugins/AVS/src/cache.cpp b/plugins/AVS/src/cache.cpp index 6c965f8cc4..3094c122e8 100644 --- a/plugins/AVS/src/cache.cpp +++ b/plugins/AVS/src/cache.cpp @@ -71,7 +71,7 @@ CacheNode* FindAvatarInCache(MCONTACT hContact, bool add, bool findAny) if (g_shutDown)
return nullptr;
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto == nullptr || !g_plugin.getByte(szProto, 1))
return nullptr;
@@ -144,7 +144,7 @@ void NotifyMetaAware(MCONTACT hContact, CacheNode *node, AVATARCACHEENTRY *ace) wcsncpy_s(cacn.filename, node->szFilename, _TRUNCATE);
// Get hash
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto != nullptr) {
DBVARIANT dbv = { 0 };
if (!db_get_s(hContact, szProto, "AvatarHash", &dbv)) {
@@ -251,7 +251,7 @@ void PicLoader(LPVOID) int result = CreateAvatarInCache(node->hContact, &ace_temp, nullptr);
if (result == -2) {
- char *szProto = GetContactProto(node->hContact);
+ char *szProto = Proto_GetBaseAccountName(node->hContact);
if (szProto == nullptr || Proto_NeedDelaysForAvatars(szProto))
QueueAdd(node->hContact);
else if (FetchAvatarFor(node->hContact, szProto) == GAIR_SUCCESS) // Try to create again
diff --git a/plugins/AVS/src/main.cpp b/plugins/AVS/src/main.cpp index adc9ac3b51..7e8c15e1e4 100644 --- a/plugins/AVS/src/main.cpp +++ b/plugins/AVS/src/main.cpp @@ -88,7 +88,7 @@ static int ProtocolAck(WPARAM, LPARAM lParam) ProcessAvatarInfo(ack->hContact, GAIR_FAILED, (PROTO_AVATAR_INFORMATION*)ack->hProcess, ack->szModule);
}
else if (ack->result == ACKRESULT_STATUS) {
- char *szProto = GetContactProto(ack->hContact);
+ char *szProto = Proto_GetBaseAccountName(ack->hContact);
if (szProto == nullptr || Proto_NeedDelaysForAvatars(szProto)) {
// Queue
db_set_b(ack->hContact, "ContactPhoto", "NeedUpdate", 1);
diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp index a16c83a7fa..beab92b5da 100644 --- a/plugins/AVS/src/options.cpp +++ b/plugins/AVS/src/options.cpp @@ -587,7 +587,7 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA db_unset(hContact, "ContactPhoto", "File"); db_unset(hContact, "ContactPhoto", "Format"); { - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); db_unset(hContact, szProto, "AvatarHash"); DeleteAvatarFromCache(hContact, FALSE); @@ -830,7 +830,7 @@ static INT_PTR CALLBACK DlgProcAvatarUserInfo(HWND hwndDlg, UINT msg, WPARAM wPa db_unset(hContact, "ContactPhoto", "File"); db_unset(hContact, "ContactPhoto", "Format"); { - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); db_unset(hContact, szProto, "AvatarHash"); DeleteAvatarFromCache(hContact, FALSE); @@ -1104,7 +1104,7 @@ int OnDetailsInit(WPARAM wParam, LPARAM hContact) g_plugin.addUserInfo(wParam, &odp); } else { - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); if (szProto == nullptr || g_plugin.getByte(szProto, 1)) { // Contact dialog odp.pfnDlgProc = DlgProcAvatarUserInfo; diff --git a/plugins/AVS/src/poll.cpp b/plugins/AVS/src/poll.cpp index ea2d970f1f..9ccaae4df2 100644 --- a/plugins/AVS/src/poll.cpp +++ b/plugins/AVS/src/poll.cpp @@ -184,7 +184,7 @@ int FetchAvatarFor(MCONTACT hContact, char *szProto) int result = GAIR_NOAVATAR;
if (szProto == nullptr)
- szProto = GetContactProto(hContact);
+ szProto = Proto_GetBaseAccountName(hContact);
if (szProto != nullptr && PollProtocolCanHaveAvatar(szProto) && PollContactCanHaveAvatar(hContact, szProto)) {
// Can have avatar, but must request it?
diff --git a/plugins/AVS/src/utils.cpp b/plugins/AVS/src/utils.cpp index 53a9d7e651..d50ae6f86b 100644 --- a/plugins/AVS/src/utils.cpp +++ b/plugins/AVS/src/utils.cpp @@ -78,7 +78,7 @@ int CreateAvatarInCache(MCONTACT hContact, AVATARCACHEENTRY *ace, const char *sz ace->szFilename[0] = 0;
if (szProto == nullptr) {
- char *proto = GetContactProto(hContact);
+ char *proto = Proto_GetBaseAccountName(hContact);
if (proto == nullptr || !g_plugin.getByte(proto, 1))
return -1;
@@ -378,7 +378,7 @@ BOOL Proto_IsFetchingWhenContactOfflineAllowed(const char *proto) protoPicCacheEntry* GetProtoDefaultAvatar(MCONTACT hContact)
{
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto)
for (auto &p : g_ProtoPictures)
if (!mir_strcmp(p->szProtoname, szProto) && p->hbmPic != nullptr)
diff --git a/plugins/AuthState/src/main.cpp b/plugins/AuthState/src/main.cpp index fe60e1c114..2b471bc150 100644 --- a/plugins/AuthState/src/main.cpp +++ b/plugins/AuthState/src/main.cpp @@ -64,7 +64,7 @@ CMPlugin::CMPlugin() : INT_PTR getIconToUse(MCONTACT hContact, LPARAM)
{
- const char *proto = GetContactProto(hContact);
+ const char *proto = Proto_GetBaseAccountName(hContact);
// if (lParam == 1) return icon_none;
if (!g_plugin.getByte(hContact, "ShowIcons", !Options.bIconsForRecentContacts))
return ICON_NONE;
@@ -103,7 +103,7 @@ int onExtraImageApplying(WPARAM hContact, LPARAM lParam) int onContactSettingChanged(WPARAM hContact, LPARAM lParam)
{
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
- const char *proto = GetContactProto((MCONTACT)hContact);
+ const char *proto = Proto_GetBaseAccountName((MCONTACT)hContact);
if (!proto)
return 0;
@@ -135,7 +135,7 @@ int onPrebuildContactMenu(WPARAM hContact, LPARAM) return 0;
}
- char *proto = GetContactProto((MCONTACT)hContact);
+ char *proto = Proto_GetBaseAccountName((MCONTACT)hContact);
if (!proto)
return 0;
diff --git a/plugins/AutoShutdown/src/watcher.cpp b/plugins/AutoShutdown/src/watcher.cpp index 0235ac9be0..e30ab9ad5f 100644 --- a/plugins/AutoShutdown/src/watcher.cpp +++ b/plugins/AutoShutdown/src/watcher.cpp @@ -177,7 +177,7 @@ static BOOL CheckAllContactsOffline(void) BOOL fSmartCheck, fAllOffline = TRUE; /* tentatively */
fSmartCheck = g_plugin.getByte("SmartOfflineCheck", SETTING_SMARTOFFLINECHECK_DEFAULT);
for (auto &hContact : Contacts()) {
- char *pszProto = GetContactProto(hContact);
+ char *pszProto = Proto_GetBaseAccountName(hContact);
if (pszProto != nullptr && Proto_GetStatus(pszProto) != ID_STATUS_OFFLINE) {
if (db_get_b(hContact, pszProto, "ChatRoom", 0)) continue;
if (db_get_w(hContact, pszProto, "Status", 0) != ID_STATUS_OFFLINE) {
@@ -198,7 +198,7 @@ static int StatusSettingChanged(WPARAM wParam, LPARAM lParam) if (currentWatcherType&SDWTF_STATUS) {
DBCONTACTWRITESETTING *dbcws = (DBCONTACTWRITESETTING*)lParam;
if ((HANDLE)wParam != nullptr && dbcws->value.wVal == ID_STATUS_OFFLINE && !strcmp(dbcws->szSetting, "Status")) {
- char *pszProto = GetContactProto(wParam);
+ char *pszProto = Proto_GetBaseAccountName(wParam);
if (pszProto != nullptr && !strcmp(dbcws->szModule, pszProto))
if (CheckAllContactsOffline())
ShutdownAndStopWatcher();
@@ -234,7 +234,7 @@ static BOOL CALLBACK CpuUsageWatcherProc(BYTE nCpuUsage, LPARAM lParam) static int WeatherUpdated(WPARAM wParam, LPARAM lParam)
{
- char *pszProto = GetContactProto(wParam);
+ char *pszProto = Proto_GetBaseAccountName(wParam);
if ((BOOL)lParam && pszProto != nullptr && Proto_GetStatus(pszProto) == ID_STATUS_INVISIBLE)
if (g_plugin.getByte("WeatherShutdown", SETTING_WEATHERSHUTDOWN_DEFAULT))
ServiceShutdown(SDSDT_SHUTDOWN, TRUE);
diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp index cc5c63a9af..8bbdb853d0 100644 --- a/plugins/AvatarHistory/src/AvatarDlg.cpp +++ b/plugins/AvatarHistory/src/AvatarDlg.cpp @@ -485,7 +485,7 @@ int CleanupAvatarPic(HWND hwnd) int PreBuildContactMenu(WPARAM wParam, LPARAM)
{
- char *proto = GetContactProto(wParam);
+ char *proto = Proto_GetBaseAccountName(wParam);
Menu_ShowItem(hMenu, 0 != ProtocolEnabled(proto));
return 0;
}
diff --git a/plugins/AvatarHistory/src/AvatarHistory.cpp b/plugins/AvatarHistory/src/AvatarHistory.cpp index b040b3d37c..6441f989f9 100644 --- a/plugins/AvatarHistory/src/AvatarHistory.cpp +++ b/plugins/AvatarHistory/src/AvatarHistory.cpp @@ -97,7 +97,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) if (hContact == NULL)
return 0;
- char *proto = GetContactProto(hContact);
+ char *proto = Proto_GetBaseAccountName(hContact);
if (proto == nullptr)
return 0;
@@ -204,7 +204,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) T2Utf blob(rel_path);
DBEVENTINFO dbei = {};
- dbei.szModule = GetContactProto(hContact);
+ dbei.szModule = Proto_GetBaseAccountName(hContact);
dbei.flags = DBEF_READ | DBEF_UTF;
dbei.timestamp = (DWORD)time(0);
dbei.eventType = EVENTTYPE_AVATAR_CHANGE;
diff --git a/plugins/AvatarHistory/src/icolib.cpp b/plugins/AvatarHistory/src/icolib.cpp index c7acb20385..2b23ea743d 100644 --- a/plugins/AvatarHistory/src/icolib.cpp +++ b/plugins/AvatarHistory/src/icolib.cpp @@ -74,7 +74,7 @@ HICON createProtoOverlayedIcon(MCONTACT hContact) {
HICON icon1 = LoadIconEx(I_OVERLAY);
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
HICON icon0 = Skin_LoadProtoIcon(szProto, ID_STATUS_ONLINE);
HICON resIcon = getOverlayedIcon(icon0, icon1, FALSE);
diff --git a/plugins/AvatarHistory/src/utils.cpp b/plugins/AvatarHistory/src/utils.cpp index 3dc10fa840..280b5acf79 100644 --- a/plugins/AvatarHistory/src/utils.cpp +++ b/plugins/AvatarHistory/src/utils.cpp @@ -34,7 +34,7 @@ bool ContactEnabled(MCONTACT hContact, char *setting, int def) if (hContact == NULL)
return false;
- char *proto = GetContactProto(hContact);
+ char *proto = Proto_GetBaseAccountName(hContact);
if (!ProtocolEnabled(proto))
return false;
@@ -106,7 +106,7 @@ wchar_t* GetProtocolFolder(wchar_t *fn, char *proto) wchar_t* GetContactFolder(wchar_t *fn, MCONTACT hContact)
{
- char *proto = GetContactProto(hContact);
+ char *proto = Proto_GetBaseAccountName(hContact);
GetProtocolFolder(fn, proto);
wchar_t uin[MAX_PATH];
diff --git a/plugins/BasicHistory/src/DatExport.cpp b/plugins/BasicHistory/src/DatExport.cpp index c21a030abe..c6a020fb05 100644 --- a/plugins/BasicHistory/src/DatExport.cpp +++ b/plugins/BasicHistory/src/DatExport.cpp @@ -151,7 +151,7 @@ bool DatExport::GetEventList(std::vector<IImport::ExternalMessage>& eventList) dataSize = header.dataSize;
DBEVENTINFO86 messageHeader;
DBEVENTINFO info = {};
- info.szModule = GetContactProto(hContact);
+ info.szModule = Proto_GetBaseAccountName(hContact);
wchar_t _str[MAXSELECTSTR + 8]; // for safety reason
std::multimap<DWORD, IImport::ExternalMessage> sortedEvents;
while (dataSize > 0) {
diff --git a/plugins/BasicHistory/src/EventList.cpp b/plugins/BasicHistory/src/EventList.cpp index 8e3b635be2..834cc025fa 100644 --- a/plugins/BasicHistory/src/EventList.cpp +++ b/plugins/BasicHistory/src/EventList.cpp @@ -394,7 +394,7 @@ std::wstring HistoryEventList::GetContactName() std::wstring HistoryEventList::GetMyName()
{
- ptrW name(Contact_GetInfo(CNF_DISPLAY, NULL, GetContactProto(m_hContact)));
+ ptrW name(Contact_GetInfo(CNF_DISPLAY, NULL, Proto_GetBaseAccountName(m_hContact)));
return (name == NULL) ? TranslateT("Me") : name;
}
@@ -421,13 +421,13 @@ std::wstring HistoryEventList::GetProtocolName() std::string HistoryEventList::GetBaseProtocol()
{
- char* proto = GetContactProto(m_hContact);
+ char* proto = Proto_GetBaseAccountName(m_hContact);
return proto == nullptr ? "" : proto;
}
std::wstring HistoryEventList::GetMyId()
{
- ptrW id(Contact_GetInfo(CNF_DISPLAYUID, NULL, GetContactProto(m_hContact)));
+ ptrW id(Contact_GetInfo(CNF_DISPLAYUID, NULL, Proto_GetBaseAccountName(m_hContact)));
return (id == NULL) ? L"" : id;
}
@@ -495,7 +495,7 @@ void HistoryEventList::MargeMessages(const std::vector<IImport::ExternalMessage> GetTempList(tempList, true, false, m_hContact);
DBEVENTINFO dbei = {};
- dbei.szModule = GetContactProto(m_hContact);
+ dbei.szModule = Proto_GetBaseAccountName(m_hContact);
db_set_safety_mode(FALSE);
for (std::list<EventTempIndex>::iterator it = tempList.begin(); it != tempList.end(); ++it) {
diff --git a/plugins/BasicHistory/src/HistoryWindow.cpp b/plugins/BasicHistory/src/HistoryWindow.cpp index 7c393354ee..22053a663c 100644 --- a/plugins/BasicHistory/src/HistoryWindow.cpp +++ b/plugins/BasicHistory/src/HistoryWindow.cpp @@ -1245,7 +1245,7 @@ void HistoryWindow::ReplaceIcons(HWND hwndDlg, int selStart, BOOL isSent) SMADD_RICHEDIT3 smadd = { 0 };
smadd.cbSize = sizeof(smadd);
smadd.hwndRichEditControl = hwndDlg;
- smadd.Protocolname = GetContactProto(m_hContact);
+ smadd.Protocolname = Proto_GetBaseAccountName(m_hContact);
smadd.hContact = m_hContact;
smadd.flags = isSent ? SAFLRE_OUTGOING : 0;
if (selStart > 0)
diff --git a/plugins/Boltun/src/boltun.cpp b/plugins/Boltun/src/boltun.cpp index deb08f133c..82a9994073 100644 --- a/plugins/Boltun/src/boltun.cpp +++ b/plugins/Boltun/src/boltun.cpp @@ -489,7 +489,7 @@ static INT_PTR ContactClickStartChatting(WPARAM hContact, LPARAM) static int OnContactMenuPrebuild(WPARAM hContact, LPARAM)
{
- INT_PTR flags = CallProtoService(GetContactProto(hContact), PS_GETCAPS, PFLAGNUM_1);
+ INT_PTR flags = CallProtoService(Proto_GetBaseAccountName(hContact), PS_GETCAPS, PFLAGNUM_1);
bool bEnable = blInit && Contact_OnList(hContact) && (flags & PF1_IM) != 0;
Menu_ShowItem(hMenuItemAutoChat, bEnable);
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index 5d90e8274e..02669fdbe3 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -228,7 +228,7 @@ bool isContactGoneFor(MCONTACT hContact, int days) ppd.lchContact = hContact;
ppd.lchIcon = IcoLib_GetIcon("enabled_icon");
- mir_snwprintf(ppd.lpwzContactName, TranslateT("Hiding %s (%S)"), Clist_GetContactDisplayName(hContact), GetContactProto(hContact));
+ mir_snwprintf(ppd.lpwzContactName, TranslateT("Hiding %s (%S)"), Clist_GetContactDisplayName(hContact), Proto_GetBaseAccountName(hContact));
mir_snwprintf(ppd.lpwzText, TranslateT("%d days since last message"), daysSinceMessage);
if (!options.iUsePopupColors) {
@@ -427,7 +427,7 @@ INT_PTR MenuMissYouClick(WPARAM hContact, LPARAM) */
int onPrebuildContactMenu(WPARAM hContact, LPARAM)
{
- char *proto = GetContactProto(hContact);
+ char *proto = Proto_GetBaseAccountName(hContact);
if (!proto)
return 0;
@@ -460,7 +460,7 @@ int SettingChanged(WPARAM hContact, LPARAM lParam) if (!Contact_OnList(hContact))
return 0;
- char *proto = GetContactProto(hContact);
+ char *proto = Proto_GetBaseAccountName(hContact);
if (proto == nullptr || (db_get_b(hContact, proto, "ChatRoom", 0) == 1)
|| !(CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND))
return 0;
@@ -539,7 +539,7 @@ int SettingChanged(WPARAM hContact, LPARAM lParam) void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD)
{
for (auto &hContact : Contacts()) {
- char *proto = GetContactProto(hContact);
+ char *proto = Proto_GetBaseAccountName(hContact);
if (proto && (db_get_b(hContact, proto, "ChatRoom", 0) == 0) && (CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND) && isContactGoneFor(hContact, options.iAbsencePeriod2) && (g_plugin.getByte(hContact, "StillAbsentNotified", 0) == 0))
{
g_plugin.setByte(hContact, "StillAbsentNotified", 1);
diff --git a/plugins/BuddyPounce/src/dialog.cpp b/plugins/BuddyPounce/src/dialog.cpp index e962347e2c..d4fc86a852 100644 --- a/plugins/BuddyPounce/src/dialog.cpp +++ b/plugins/BuddyPounce/src/dialog.cpp @@ -13,7 +13,7 @@ void populateSettingsList(HWND hwnd2List) void populateContacts(MCONTACT BPhContact, HWND hwnd2CB)
{
for (auto &hContact : Contacts()) {
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto && (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM)) {
wchar_t name[300];
mir_snwprintf(name, L"%s (%S)", Clist_GetContactDisplayName(hContact), szProto);
diff --git a/plugins/BuddyPounce/src/main.cpp b/plugins/BuddyPounce/src/main.cpp index 1e83f43d36..bf7de24bb2 100644 --- a/plugins/BuddyPounce/src/main.cpp +++ b/plugins/BuddyPounce/src/main.cpp @@ -65,7 +65,7 @@ int MsgAck(WPARAM, LPARAM lParam) int PrebuildContactMenu(WPARAM hContact, LPARAM)
{
- Menu_ShowItem(g_hMenuItem, (CallProtoService(GetContactProto(hContact), PS_GETCAPS, PFLAGNUM_1) & PF1_IM) != 0);
+ Menu_ShowItem(g_hMenuItem, (CallProtoService(Proto_GetBaseAccountName(hContact), PS_GETCAPS, PFLAGNUM_1) & PF1_IM) != 0);
return 0;
}
@@ -124,7 +124,7 @@ int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam) {
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (hContact == NULL || strcmp(cws->szSetting, "Status")) return 0;
if (szProto && (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM)) {
int newStatus = cws->value.wVal;
diff --git a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp index 655f626bd8..8ea557eb05 100644 --- a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp +++ b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp @@ -151,7 +151,7 @@ void ShowPopup(SHOWPOPUP_DATA *sd) PLUGIN_DATA *pdata = (PLUGIN_DATA*)calloc(1, sizeof(PLUGIN_DATA));
POPUPDATAW ppd;
ppd.lchContact = sd->hContact;
- char *szProto = GetContactProto(sd->hContact);
+ char *szProto = Proto_GetBaseAccountName(sd->hContact);
pdata->hIcon = ppd.lchIcon = Finger_GetClientIcon(sd->MirVer, false);
_ASSERT(ppd.lchIcon);
if (!ppd.lchIcon || (INT_PTR)ppd.lchIcon == CALLSERVICE_NOTFOUND) {
@@ -187,7 +187,7 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) if (!hContact) // exit if hContact == NULL and it's not a popup preview
return 0;
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (!mir_strcmp(szProto, META_PROTO)) // workaround for metacontacts
return 0;
diff --git a/plugins/Clist_modern/src/modern_awaymsg.cpp b/plugins/Clist_modern/src/modern_awaymsg.cpp index 05102aff2a..a8fc05a682 100644 --- a/plugins/Clist_modern/src/modern_awaymsg.cpp +++ b/plugins/Clist_modern/src/modern_awaymsg.cpp @@ -144,7 +144,7 @@ void amRequestAwayMsg(MCONTACT hContact) return;
//Do not re-ask for chat rooms
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto != nullptr && !db_get_b(hContact, szProto, "ChatRoom", 0))
amAddHandleToChain(hContact);
}
diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp index cb9afa6e86..a011f8e511 100644 --- a/plugins/Clist_modern/src/modern_cachefuncs.cpp +++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp @@ -192,7 +192,7 @@ void CSmileyString::ReplaceSmileys(ClcData *dat, ClcCacheEntry *pdnce, wchar_t * if (db_get_b(0, "CLC", "Meta", SETTING_USEMETAICON_DEFAULT) != 1 && pdnce->szProto != nullptr && mir_strcmp(pdnce->szProto, META_PROTO) == 0) { MCONTACT hContact = db_mc_getMostOnline(pdnce->hContact); if (hContact != 0) - sp.Protocolname = GetContactProto(hContact); + sp.Protocolname = Proto_GetBaseAccountName(hContact); } } else sp.Protocolname = "clist"; diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index ba22aacff4..2d79ea46c0 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -1338,7 +1338,7 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT, WPARAM wParam ClcGroup *selgroup;
ClcContact *selcontact = nullptr;
- char *szProto = GetContactProto(wParam);
+ char *szProto = Proto_GetBaseAccountName(wParam);
WORD status = (szProto == nullptr) ? ID_STATUS_OFFLINE : GetContactCachedStatus(wParam);
bool bImageIsSpecial = (LOWORD(contacticon) != (LOWORD(lParam))); //check only base icons
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index f77e7ebf9f..781f13a78d 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -325,7 +325,7 @@ ClcCacheEntry* cliCreateCacheItem(MCONTACT hContact) return nullptr;
pdnce->hContact = hContact;
- pdnce->szProto = GetContactProto(hContact);
+ pdnce->szProto = Proto_GetBaseAccountName(hContact);
pdnce->bIsHidden = Contact_IsHidden(hContact);
pdnce->m_bIsSub = db_mc_isSub(hContact) != 0;
pdnce->m_bNoHiddenOffline = g_plugin.getByte(hContact, "noOffline");
@@ -417,7 +417,7 @@ int CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, ClcData *dat) if (pdnce && g_CluiData.bFilterEffective && dat != nullptr && !dat->bForceInDialog) {
if (szProto == nullptr)
- szProto = GetContactProto(hContact);
+ szProto = Proto_GetBaseAccountName(hContact);
// check stickies first (priority), only if we really have stickies defined (CLVM_STICKY_CONTACTS is set).
if (g_CluiData.bFilterEffective & CLVM_STICKY_CONTACTS) {
if (DWORD dwLocalMask = db_get_dw(hContact, CLVM_MODULE, g_CluiData.current_viewmode, 0)) {
@@ -435,7 +435,7 @@ int CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, ClcData *dat) mir_snprintf(szTemp, "%s|", szProto);
if (db_mc_isMeta(hContact)) {
for (int i = db_mc_getSubCount(hContact) - 1; i >= 0; i--) {
- mir_snprintf(szTemp, "%s|", GetContactProto(db_mc_getSub(hContact, i)));
+ mir_snprintf(szTemp, "%s|", Proto_GetBaseAccountName(db_mc_getSub(hContact, i)));
if (strstr(g_CluiData.protoFilter, szTemp) != 0) {
filterResult = 1;
break;
diff --git a/plugins/Clist_modern/src/modern_clistevents.cpp b/plugins/Clist_modern/src/modern_clistevents.cpp index 882c16f3df..4b0e1ef024 100644 --- a/plugins/Clist_modern/src/modern_clistevents.cpp +++ b/plugins/Clist_modern/src/modern_clistevents.cpp @@ -108,7 +108,7 @@ CListEvent* cli_AddEvent(CLISTEVENT *cle) }
}
- char *szProto = GetContactProto(p->hContact);
+ char *szProto = Proto_GetBaseAccountName(p->hContact);
wchar_t *szName = Clist_GetContactDisplayName(p->hContact);
if (szProto && szName) {
NotifyMenuItemExData *nmi = (struct NotifyMenuItemExData *) malloc(sizeof(struct NotifyMenuItemExData));
diff --git a/plugins/Clist_modern/src/modern_clistsettings.cpp b/plugins/Clist_modern/src/modern_clistsettings.cpp index e5cb54cb52..5aeca061f2 100644 --- a/plugins/Clist_modern/src/modern_clistsettings.cpp +++ b/plugins/Clist_modern/src/modern_clistsettings.cpp @@ -49,7 +49,7 @@ void cliCheckCacheItem(ClcCacheEntry *pdnce) }
if (pdnce->szProto == nullptr) {
- pdnce->szProto = GetContactProto(pdnce->hContact);
+ pdnce->szProto = Proto_GetBaseAccountName(pdnce->hContact);
if (pdnce->szProto && pdnce->tszName)
mir_free_and_nil(pdnce->tszName);
}
@@ -96,7 +96,7 @@ int GetContactCachedStatus(MCONTACT hContact) int ContactAdded(WPARAM hContact, LPARAM)
{
if (!MirandaExiting())
- Clist_ChangeContactIcon(hContact, g_clistApi.pfnIconFromStatusMode(GetContactProto(hContact), ID_STATUS_OFFLINE, hContact));
+ Clist_ChangeContactIcon(hContact, g_clistApi.pfnIconFromStatusMode(Proto_GetBaseAccountName(hContact), ID_STATUS_OFFLINE, hContact));
return 0;
}
@@ -183,7 +183,7 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) }
else if (!strcmp(cws->szModule, "Protocol")) {
if (!strcmp(cws->szSetting, "p")) {
- pdnce->szProto = GetContactProto(hContact);
+ pdnce->szProto = Proto_GetBaseAccountName(hContact);
char *szProto = (cws->value.type == DBVT_DELETED) ? nullptr : cws->value.pszVal;
Clist_ChangeContactIcon(hContact, g_clistApi.pfnIconFromStatusMode(szProto, pdnce->getStatus(), hContact));
}
diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp index ec0104e8ce..352d37898c 100644 --- a/plugins/Clist_nicer/src/clc.cpp +++ b/plugins/Clist_nicer/src/clc.cpp @@ -117,7 +117,7 @@ static int ClcSettingChanged(WPARAM hContact, LPARAM lParam) else if (!__strcmp(cws->szSetting, "Timezone") || !__strcmp(cws->szSetting, "TzName"))
ReloadExtraInfo(hContact);
}
- else if (hContact != 0 && (szProto = GetContactProto(hContact)) != nullptr) {
+ else if (hContact != 0 && (szProto = Proto_GetBaseAccountName(hContact)) != nullptr) {
if (!__strcmp(cws->szModule, "Protocol") && !__strcmp(cws->szSetting, "p")) {
char *szProto_s;
Clist_Broadcast(INTM_PROTOCHANGED, hContact, lParam);
@@ -312,7 +312,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L MCONTACT hSelItem = NULL;
ClcContact *selcontact = nullptr;
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto == nullptr)
status = ID_STATUS_OFFLINE;
else
@@ -376,7 +376,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if (contact->bIsMeta && !(cfg::dat.dwFlags & CLUI_USEMETAICONS)) {
contact->hSubContact = db_mc_getMostOnline(contact->hContact);
- contact->metaProto = GetContactProto(contact->hSubContact);
+ contact->metaProto = Proto_GetBaseAccountName(contact->hSubContact);
contact->iImage = Clist_GetContactIcon(contact->hSubContact);
if (contact->pExtra) {
TExtraCache *pSub = cfg::getCache(contact->hSubContact, contact->metaProto);
@@ -488,7 +488,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if (!Clist_FindItem(hwnd, dat, wParam, &contact))
break;
- contact->pce->szProto = GetContactProto(wParam);
+ contact->pce->szProto = Proto_GetBaseAccountName(wParam);
g_clistApi.pfnInvalidateDisplayNameCacheEntry(wParam);
mir_wstrncpy(contact->szText, Clist_GetContactDisplayName(wParam), _countof(contact->szText));
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index 2586c4bf0d..9498dec0e5 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -105,7 +105,7 @@ ClcContact* AddContactToGroup(struct ClcData *dat, ClcGroup *group, MCONTACT hCo p->bIsMeta = FALSE;
if (p->bIsMeta && !(cfg::dat.dwFlags & CLUI_USEMETAICONS)) {
p->hSubContact = db_mc_getMostOnline(hContact);
- p->metaProto = GetContactProto(p->hSubContact);
+ p->metaProto = Proto_GetBaseAccountName(p->hSubContact);
p->iImage = Clist_GetContactIcon(p->hSubContact);
}
else {
@@ -166,7 +166,7 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) p->bStatusMsgValid = STATUSMSG_CLIST;
else {
if (!szProto)
- szProto = GetContactProto(hContact);
+ szProto = Proto_GetBaseAccountName(hContact);
if (szProto) {
if (!result)
db_free(&dbv);
@@ -383,7 +383,7 @@ int CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, struct ClcData return dbHidden;
if (szProto == nullptr)
- szProto = GetContactProto(hContact);
+ szProto = Proto_GetBaseAccountName(hContact);
// check stickies first (priority), only if we really have stickies defined (CLVM_STICKY_CONTACTS is set).
if (cfg::dat.bFilterEffective & CLVM_STICKY_CONTACTS) {
DWORD dwLocalMask = db_get_dw(hContact, "CLVM", cfg::dat.current_viewmode, 0);
diff --git a/plugins/Clist_nicer/src/clistevents.cpp b/plugins/Clist_nicer/src/clistevents.cpp index ad9bd69be0..5bd2930d92 100644 --- a/plugins/Clist_nicer/src/clistevents.cpp +++ b/plugins/Clist_nicer/src/clistevents.cpp @@ -252,7 +252,7 @@ CListEvent* AddEvent(CLISTEVENT *cle) }
}
- char *szProto = GetContactProto(p->hContact);
+ char *szProto = Proto_GetBaseAccountName(p->hContact);
wchar_t *szName = Clist_GetContactDisplayName(p->hContact);
if (szProto && szName) {
NotifyMenuItemExData *nmi = (NotifyMenuItemExData*)malloc(sizeof(NotifyMenuItemExData));
diff --git a/plugins/Clist_nicer/src/clistmod.cpp b/plugins/Clist_nicer/src/clistmod.cpp index 73c10bbd16..a889752c3b 100644 --- a/plugins/Clist_nicer/src/clistmod.cpp +++ b/plugins/Clist_nicer/src/clistmod.cpp @@ -44,7 +44,7 @@ int IconFromStatusMode(const char *szProto, int status, MCONTACT hContact) if (szProto != nullptr && !mir_strcmp(szProto, META_PROTO) && hContact != 0 && !(cfg::dat.dwFlags & CLUI_USEMETAICONS)) {
MCONTACT hSubContact = db_mc_getMostOnline(hContact);
- szFinalProto = GetContactProto(hSubContact);
+ szFinalProto = Proto_GetBaseAccountName(hSubContact);
finalStatus = (status == 0) ? db_get_w(hSubContact, szFinalProto, "Status", ID_STATUS_OFFLINE) : status;
hContact = hSubContact;
}
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 544fe91482..f688fbf6db 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -400,7 +400,7 @@ void SetDBButtonStates(MCONTACT hPassedContact) continue; } if (buttonItem->dwFlags & BUTTON_ISCONTACTDBACTION) - szModule = GetContactProto(hContact); + szModule = Proto_GetBaseAccountName(hContact); hFinalContact = hContact; } else @@ -1348,7 +1348,7 @@ skipbg: } else if (item->dwFlags & BUTTON_ISPROTOSERVICE && cfg::clcdat) { if (contactOK) { - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); if (ProtoServiceExists(szProto, item->szService)) CallProtoService(szProto, item->szService, wwParam, llParam); else @@ -1364,7 +1364,7 @@ skipbg: if (item->dwFlags & BUTTON_ISCONTACTDBACTION || item->dwFlags & BUTTON_DBACTIONONCONTACT) { contactOK = ServiceParamsOK(item, &wwParam, &llParam, hContact); if (contactOK && item->dwFlags & BUTTON_ISCONTACTDBACTION) - szModule = GetContactProto(hContact); + szModule = Proto_GetBaseAccountName(hContact); finalhContact = hContact; } else diff --git a/plugins/Clist_nicer/src/contact.cpp b/plugins/Clist_nicer/src/contact.cpp index 055b63d012..fbe2680de5 100644 --- a/plugins/Clist_nicer/src/contact.cpp +++ b/plugins/Clist_nicer/src/contact.cpp @@ -44,7 +44,7 @@ static int GetContactStatus(MCONTACT hContact) {
char *szProto;
- szProto = GetContactProto(hContact);
+ szProto = Proto_GetBaseAccountName(hContact);
if (szProto == nullptr)
return ID_STATUS_OFFLINE;
return db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp index 1ac9c420a8..ee38fcaafd 100644 --- a/plugins/Clist_nicer/src/extBackg.cpp +++ b/plugins/Clist_nicer/src/extBackg.cpp @@ -1271,7 +1271,7 @@ void LoadPerContactSkins(wchar_t *tszFileName) if (items) {
for (auto &hContact : Contacts()) {
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto == nullptr)
continue;
diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp index 4aeaa16d74..74bfa10f37 100644 --- a/plugins/CmdLine/src/mimcmd_handlers.cpp +++ b/plugins/CmdLine/src/mimcmd_handlers.cpp @@ -1167,7 +1167,7 @@ void HandleContactsCommand(PCommand command, TArgument *argv, int argc, PReply r reply->code = MIMRES_SUCCESS;
for (auto &hContact : Contacts()) {
- GetContactProto(hContact, protocol, _countof(protocol));
+ Proto_GetBaseAccountName(hContact, protocol, _countof(protocol));
ptrW contact(GetContactName(hContact, protocol));
ptrW id(GetContactID(hContact, protocol));
@@ -1197,7 +1197,7 @@ void HandleContactsCommand(PCommand command, TArgument *argv, int argc, PReply r reply->code = MIMRES_SUCCESS;
*reply->message = 0;
for (auto &hContact : Contacts()) {
- GetContactProto(hContact, protocol, _countof(protocol));
+ Proto_GetBaseAccountName(hContact, protocol, _countof(protocol));
ptrW contact(GetContactName(hContact, protocol));
ptrW id(GetContactID(hContact, protocol));
@@ -1276,7 +1276,7 @@ void HandleHistoryCommand(PCommand command, TArgument *argv, int argc, PReply re }
char protocol[128];
- GetContactProto(hContact, protocol, _countof(protocol));
+ Proto_GetBaseAccountName(hContact, protocol, _countof(protocol));
ptrW contact(GetContactName(hContact, protocol));
mir_snwprintf(buffer, TranslateT("%s:%S - %d unread events."), contact, protocol, count);
diff --git a/plugins/CmdLine/src/utils.cpp b/plugins/CmdLine/src/utils.cpp index e877aa6477..86da417721 100644 --- a/plugins/CmdLine/src/utils.cpp +++ b/plugins/CmdLine/src/utils.cpp @@ -140,7 +140,7 @@ wchar_t* GetContactName(MCONTACT hContact, char *szProto) return Contact_GetInfo(CNF_DISPLAY, hContact, szProto);
}
-void GetContactProto(MCONTACT hContact, char *szProto, size_t size)
+void Proto_GetBaseAccountName(MCONTACT hContact, char *szProto, size_t size)
{
GetStringFromDatabase(hContact, "Protocol", "p", nullptr, szProto, size);
}
@@ -157,7 +157,7 @@ MCONTACT GetContactFromID(wchar_t *szID, char *szProto) int found = 0;
for (auto &hContact : Contacts()) {
- GetContactProto(hContact, cProtocol, sizeof(cProtocol));
+ Proto_GetBaseAccountName(hContact, cProtocol, sizeof(cProtocol));
ptrW szHandle(GetContactID(hContact, cProtocol));
wchar_t *tmp = Clist_GetContactDisplayName(hContact);
diff --git a/plugins/CmdLine/src/utils.h b/plugins/CmdLine/src/utils.h index 617f329391..f87c8e6a97 100644 --- a/plugins/CmdLine/src/utils.h +++ b/plugins/CmdLine/src/utils.h @@ -46,7 +46,7 @@ int GetStringFromDatabase(char *szSettingName, WCHAR *szError, WCHAR *szResult, wchar_t* GetContactName(MCONTACT hContact, char *szProto);
wchar_t* GetContactID(MCONTACT hContact, char *szProto);
MCONTACT GetContactFromID(wchar_t *szID, char *szProto);
-void GetContactProto(MCONTACT hContact, char *szProto, size_t size);
+void Proto_GetBaseAccountName(MCONTACT hContact, char *szProto, size_t size);
int MyPUShowMessage(char *lpzText, BYTE kind);
diff --git a/plugins/ContactsPlus/src/main.cpp b/plugins/ContactsPlus/src/main.cpp index 6a2c053891..1b759ce240 100644 --- a/plugins/ContactsPlus/src/main.cpp +++ b/plugins/ContactsPlus/src/main.cpp @@ -110,7 +110,7 @@ static bool CheckContactsServiceSupport(const char* szProto) static int HookPreBuildContactMenu(WPARAM hContact, LPARAM)
{
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
bool bVisible = false;
if (szProto && CheckContactsServiceSupport(szProto)) {
@@ -149,7 +149,7 @@ static int HookModulesLoaded(WPARAM, LPARAM) static int HookContactSettingChanged(WPARAM hContact, LPARAM lParam)
{
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (strcmpnull(cws->szModule, "CList") && strcmpnull(cws->szModule, szProto))
return 0;
diff --git a/plugins/ContactsPlus/src/receive.cpp b/plugins/ContactsPlus/src/receive.cpp index 144f91ce41..2a6144c5b3 100644 --- a/plugins/ContactsPlus/src/receive.cpp +++ b/plugins/ContactsPlus/src/receive.cpp @@ -139,7 +139,7 @@ static void RebuildGroupCombo(HWND hwndDlg) static MCONTACT CreateTemporaryContactForItem(HWND hwndDlg, TRecvContactsData *wndData, int iItem)
{
wchar_t *caUIN = ListView_GetItemTextEx(GetDlgItem(hwndDlg, IDC_CONTACTS), iItem, 0);
- char *szProto = GetContactProto(wndData->mhContact);
+ char *szProto = Proto_GetBaseAccountName(wndData->mhContact);
wndData->rhSearch = (HANDLE)CallProtoService(szProto, PS_BASICSEARCH, 0, (LPARAM)caUIN); // find it
replaceStrW(wndData->haUin, caUIN);
for (int j = 0; j < wndData->cbReceived; j++)
@@ -181,7 +181,7 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara TranslateMenu(wndData->mhPopup);
wndData->hHook = HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_EVENTSENT);
- char *szProto =GetContactProto(wndData->mhContact);
+ char *szProto =Proto_GetBaseAccountName(wndData->mhContact);
HWND hLV = GetDlgItem(hwndDlg, IDC_CONTACTS);
ListView_SetExtendedListViewStyle(hLV, LVS_EX_CHECKBOXES|LVS_EX_FULLROWSELECT);
@@ -314,7 +314,7 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara wchar_t *caUIN = ListView_GetItemTextEx(hLV, i, 0);
for (int j = 0; j < wndData->cbReceived; j++) // determine item index in packet
if (!mir_wstrcmp(wndData->maReceived[j]->mcaUIN, caUIN)) {
- char *szProto =GetContactProto(wndData->mhContact);
+ char *szProto =Proto_GetBaseAccountName(wndData->mhContact);
hContact = (MCONTACT)CallProtoService(szProto, PS_ADDTOLISTBYEVENT, MAKEWPARAM(0, j), (LPARAM)wndData->mhDbEvent);
if (hContact && caGroup)
Clist_ContactChangeGroup(hContact, nGroupId);
diff --git a/plugins/ContactsPlus/src/send.cpp b/plugins/ContactsPlus/src/send.cpp index 71e44df0b2..c082aca4b7 100644 --- a/plugins/ContactsPlus/src/send.cpp +++ b/plugins/ContactsPlus/src/send.cpp @@ -133,7 +133,7 @@ int TSendContactsData::SendContactsPacket(HWND hwndDlg, MCONTACT *phContacts, in int TSendContactsData::SendContacts(HWND hwndDlg)
{
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
int nMaxContacts = CallProtoService(szProto, PS_GETCAPS, PFLAG_MAXCONTACTSPERPACKET, hContact);
if (!nMaxContacts) {
@@ -196,7 +196,7 @@ static void SetAllContactChecks(HWND hwndList, MCONTACT hReceiver) // doubtful n return;
binListEvent = TRUE;
- char *szProto = GetContactProto(hReceiver);
+ char *szProto = Proto_GetBaseAccountName(hReceiver);
if (szProto == nullptr)
return;
@@ -207,7 +207,7 @@ static void SetAllContactChecks(HWND hwndList, MCONTACT hReceiver) // doubtful n MCONTACT hItem, hContact = FindFirstClistContact(hwndList, &hItem);
while (hContact) {
- char* szProto2 = GetContactProto(hContact);
+ char* szProto2 = Proto_GetBaseAccountName(hContact);
// different protocols or protocol undefined, remove contact, useless anyway
if (strcmpnull(szProto, szProto2))
@@ -399,7 +399,7 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara }
DBEVENTINFO dbei = {};
- dbei.szModule = GetContactProto(ackData->hContact);
+ dbei.szModule = Proto_GetBaseAccountName(ackData->hContact);
dbei.eventType = EVENTTYPE_CONTACTS;
dbei.flags = DBEF_SENT | DBEF_UTF;
dbei.timestamp = time(0);
diff --git a/plugins/ContactsPlus/src/utils.cpp b/plugins/ContactsPlus/src/utils.cpp index 4656317da4..f5563456be 100644 --- a/plugins/ContactsPlus/src/utils.cpp +++ b/plugins/ContactsPlus/src/utils.cpp @@ -57,7 +57,7 @@ char* __fastcall null_strdup(const char *string) wchar_t* GetContactUID(MCONTACT hContact)
{
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
const char *uid = Proto_GetUniqueId(szProto);
if (uid == nullptr)
return nullptr;
@@ -109,7 +109,7 @@ void UpdateDialogTitle(HWND hwndDlg, MCONTACT hContact, wchar_t *pszTitleStart) mir_wstrncpy(newtitle, TranslateW(pszTitleStart), _countof(newtitle));
if (hContact) {
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto) {
ptrW uid(GetContactUID(hContact));
wchar_t *contactName = Clist_GetContactDisplayName(hContact);
@@ -150,7 +150,7 @@ HICON InitMButton(HWND hDlg, int idButton, int idIcon, wchar_t *szTip) HICON LoadContactProtoIcon(MCONTACT hContact)
{
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto)
return (HICON)CallProtoService(szProto, PS_LOADICON, PLI_PROTOCOL | PLIF_SMALL, 0);
return nullptr;
diff --git a/plugins/CountryFlags/src/extraimg.cpp b/plugins/CountryFlags/src/extraimg.cpp index 867239a6af..54e32b3c75 100644 --- a/plugins/CountryFlags/src/extraimg.cpp +++ b/plugins/CountryFlags/src/extraimg.cpp @@ -27,7 +27,7 @@ static HANDLE hServiceDetectContactOrigin; static INT_PTR ServiceDetectContactOriginCountry(WPARAM hContact, LPARAM)
{
int countryNumber = 0xFFFF;
- char *pszProto = GetContactProto(hContact);
+ char *pszProto = Proto_GetBaseAccountName(hContact);
/* ip detect */
if (bUseIpToCountry)
countryNumber = ServiceIpToCountry(db_get_dw(hContact, pszProto, "RealIP", 0), 0);
diff --git a/plugins/Db3x_mmap/src/dbsettings.cpp b/plugins/Db3x_mmap/src/dbsettings.cpp index e3bd3ffb7c..d1bff4d180 100644 --- a/plugins/Db3x_mmap/src/dbsettings.cpp +++ b/plugins/Db3x_mmap/src/dbsettings.cpp @@ -208,7 +208,7 @@ LBL_Seek: // try to get the missing mc setting from the active sub
if (cc && cc->IsMeta() && ValidLookupName(szModule, szSetting)) {
if (contactID = db_mc_getDefault(contactID)) {
- if (szModule = GetContactProto(contactID)) {
+ if (szModule = Proto_GetBaseAccountName(contactID)) {
moduleNameLen = (int)mir_strlen(szModule);
goto LBL_Seek;
}
diff --git a/plugins/Dbx_mdbx/src/dbsettings.cpp b/plugins/Dbx_mdbx/src/dbsettings.cpp index 6d5d90ce1d..253c999625 100644 --- a/plugins/Dbx_mdbx/src/dbsettings.cpp +++ b/plugins/Dbx_mdbx/src/dbsettings.cpp @@ -101,7 +101,7 @@ LBL_Seek: // try to get the missing mc setting from the active sub
if (cc && cc->IsMeta() && ValidLookupName(szModule, szSetting)) {
if (contactID = db_mc_getDefault(contactID)) {
- if (szModule = GetContactProto(contactID)) {
+ if (szModule = Proto_GetBaseAccountName(contactID)) {
moduleNameLen = strlen(szModule);
goto LBL_Seek;
}
diff --git a/plugins/Dbx_sqlite/src/dbsettings.cpp b/plugins/Dbx_sqlite/src/dbsettings.cpp index fcd2281ddd..8da14b6d9e 100755 --- a/plugins/Dbx_sqlite/src/dbsettings.cpp +++ b/plugins/Dbx_sqlite/src/dbsettings.cpp @@ -125,7 +125,7 @@ LBL_Seek: sqlite3_reset(stmt); if (rc == SQLITE_DONE && cc && cc->IsMeta() && ValidLookupName(szModule, szSetting)) { if (hContact = db_mc_getDefault(hContact)) { - if (szModule = GetContactProto(hContact)) + if (szModule = Proto_GetBaseAccountName(hContact)) goto LBL_Seek; } } diff --git a/plugins/FTPFileYM/src/ftpfile.cpp b/plugins/FTPFileYM/src/ftpfile.cpp index eabee7f882..84c26bde71 100644 --- a/plugins/FTPFileYM/src/ftpfile.cpp +++ b/plugins/FTPFileYM/src/ftpfile.cpp @@ -181,7 +181,7 @@ int PrebuildContactMenu(WPARAM wParam, LPARAM) {
bool bIsContact = false;
- char *szProto = GetContactProto(wParam);
+ char *szProto = Proto_GetBaseAccountName(wParam);
if (szProto) bIsContact = (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM) ? true : false;
bool bHideRoot = opt.bHideInactive;
diff --git a/plugins/FTPFileYM/src/job_generic.cpp b/plugins/FTPFileYM/src/job_generic.cpp index 5596a1998b..68e008dfb9 100644 --- a/plugins/FTPFileYM/src/job_generic.cpp +++ b/plugins/FTPFileYM/src/job_generic.cpp @@ -232,7 +232,7 @@ void GenericJob::refreshTab(bool bTabChanged) {
if (bTabChanged) {
if (m_hContact != NULL) {
- SendDlgItemMessage(uDlg->m_hwnd, IDC_BTN_PROTO, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_LoadProtoIcon(GetContactProto(m_hContact), ID_STATUS_ONLINE));
+ SendDlgItemMessage(uDlg->m_hwnd, IDC_BTN_PROTO, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_LoadProtoIcon(Proto_GetBaseAccountName(m_hContact), ID_STATUS_ONLINE));
SetDlgItemText(uDlg->m_hwnd, IDC_UP_CONTACT, Clist_GetContactDisplayName(m_hContact));
}
else {
diff --git a/plugins/FTPFileYM/src/job_upload.cpp b/plugins/FTPFileYM/src/job_upload.cpp index 04eca7a490..e01328b428 100644 --- a/plugins/FTPFileYM/src/job_upload.cpp +++ b/plugins/FTPFileYM/src/job_upload.cpp @@ -80,7 +80,7 @@ void UploadJob::autoSend() if (m_hContact == NULL)
return;
- char *szProto = GetContactProto(m_hContact);
+ char *szProto = Proto_GetBaseAccountName(m_hContact);
if (szProto == nullptr)
return;
diff --git a/plugins/FavContacts/src/favlist.h b/plugins/FavContacts/src/favlist.h index 3bf8899ffc..eeaea0d6ea 100644 --- a/plugins/FavContacts/src/favlist.h +++ b/plugins/FavContacts/src/favlist.h @@ -24,7 +24,7 @@ public: else
group = mir_wstrdup(TranslateT("Favorite Contacts"));
- status = db_get_w(hContact, GetContactProto(hContact), "Status", ID_STATUS_OFFLINE);
+ status = db_get_w(hContact, Proto_GetBaseAccountName(hContact), "Status", ID_STATUS_OFFLINE);
}
~TContactInfo()
diff --git a/plugins/FavContacts/src/http_api.cpp b/plugins/FavContacts/src/http_api.cpp index c3c97ca5b5..eb4ca9140e 100644 --- a/plugins/FavContacts/src/http_api.cpp +++ b/plugins/FavContacts/src/http_api.cpp @@ -76,7 +76,7 @@ public: MCONTACT hContact = favList[i]->getHandle();
wchar_t *name = Clist_GetContactDisplayName(hContact);
AVATARCACHEENTRY *avatar = (AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, hContact, 0);
- int status = db_get_w(hContact, GetContactProto(hContact), "Status", ID_STATUS_OFFLINE);
+ int status = db_get_w(hContact, Proto_GetBaseAccountName(hContact), "Status", ID_STATUS_OFFLINE);
Send("SetContact(");
Send(i);
diff --git a/plugins/FavContacts/src/menu.cpp b/plugins/FavContacts/src/menu.cpp index 086d303557..de3817148a 100644 --- a/plugins/FavContacts/src/menu.cpp +++ b/plugins/FavContacts/src/menu.cpp @@ -73,7 +73,7 @@ static BOOL sttMeasureItem_Contact(LPMEASUREITEMSTRUCT lpmis, Options *options) bool bFree = false;
wchar_t *title = db_get_wsa(hContact, "CList", "StatusMsg");
if (title == nullptr) {
- char *proto = GetContactProto(hContact);
+ char *proto = Proto_GetBaseAccountName(hContact);
int status = db_get_w(hContact, proto, "Status", ID_STATUS_OFFLINE);
title = Clist_GetStatusModeDescription(status, 0);
}
@@ -239,7 +239,7 @@ static BOOL sttDrawItem_Contact(LPDRAWITEMSTRUCT lpdis, Options *options = nullp lpdis->rcItem.top += 2;
lpdis->rcItem.bottom -= 2;
- char *proto = GetContactProto(hContact);
+ char *proto = Proto_GetBaseAccountName(hContact);
HIMAGELIST hIml = Clist_GetImageList();
int iIcon = Clist_GetContactIcon(hContact);
diff --git a/plugins/FileAsMessage/src/dialog.cpp b/plugins/FileAsMessage/src/dialog.cpp index 4613b97438..a1b4601812 100644 --- a/plugins/FileAsMessage/src/dialog.cpp +++ b/plugins/FileAsMessage/src/dialog.cpp @@ -899,7 +899,7 @@ INT_PTR CALLBACK DialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_FE_STATUSCHANGE:
{
- char *szProto = GetContactProto(dat->hContact);
+ char *szProto = Proto_GetBaseAccountName(dat->hContact);
if (szProto) {
int dwStatus = db_get_w(dat->hContact, szProto, "Status", ID_STATUS_OFFLINE);
if (dat->inSend && dwStatus != dat->contactStatus) {
diff --git a/plugins/FingerprintNG/src/fingerprint.cpp b/plugins/FingerprintNG/src/fingerprint.cpp index 83ae37180d..afc4ed2b7b 100644 --- a/plugins/FingerprintNG/src/fingerprint.cpp +++ b/plugins/FingerprintNG/src/fingerprint.cpp @@ -803,7 +803,7 @@ int OnExtraImageApply(WPARAM hContact, LPARAM) return 0; ptrW tszMirver; - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); if (szProto != nullptr) tszMirver = db_get_wsa(hContact, szProto, "MirVer"); @@ -856,7 +856,7 @@ static int OnSrmmWindowEvent(WPARAM, LPARAM lParam) if (event->uType == MSG_WINDOW_EVT_OPEN) { ptrW ptszMirVer; - char *szProto = GetContactProto(event->hContact); + char *szProto = Proto_GetBaseAccountName(event->hContact); if (szProto != nullptr) ptszMirVer = db_get_wsa(event->hContact, szProto, "MirVer"); SetSrmmIcon(event->hContact, ptszMirVer); diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp index dbea0666ee..c59c5ef17a 100644 --- a/plugins/FloatingContacts/src/main.cpp +++ b/plugins/FloatingContacts/src/main.cpp @@ -580,7 +580,7 @@ static int GetContactStatus(MCONTACT hContact) return 0;
}
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto == nullptr)
return ID_STATUS_OFFLINE;
diff --git a/plugins/FloatingContacts/src/thumbs.cpp b/plugins/FloatingContacts/src/thumbs.cpp index b921ee6460..8455c8b8ef 100644 --- a/plugins/FloatingContacts/src/thumbs.cpp +++ b/plugins/FloatingContacts/src/thumbs.cpp @@ -245,7 +245,7 @@ void ThumbInfo::ResizeThumb() HDC hdc = GetWindowDC(hwnd);
if (Contact_OnList(hContact)) {
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (nullptr != szProto) {
int nStatus = Proto_GetStatus(szProto);
int nContactStatus = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
@@ -573,7 +573,7 @@ void ThumbInfo::UpdateContent() oldBkMode = SetBkMode(hdcDraw, TRANSPARENT);
if (Contact_OnList(hContact)) {
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (nullptr != szProto) {
int nStatus = Proto_GetStatus(szProto);
int nContactStatus = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
diff --git a/plugins/HistoryPlusPlus/GlobalSearch.pas b/plugins/HistoryPlusPlus/GlobalSearch.pas index 05952b571e..6cd4e103eb 100644 --- a/plugins/HistoryPlusPlus/GlobalSearch.pas +++ b/plugins/HistoryPlusPlus/GlobalSearch.pas @@ -576,7 +576,7 @@ begin if CurContact = 0 then
CurProto := 'ICQ'
else
- CurProto := GetContactProto(CurContact);
+ CurProto := Proto_GetBaseAccountName(CurContact);
laProgress.Caption := Format(TranslateW('Searching "%s"...'),
[GetContactDisplayName(CurContact, CurProto, True)]);
end;
diff --git a/plugins/HistoryPlusPlus/historypp.dpr b/plugins/HistoryPlusPlus/historypp.dpr index 71841fb8bf..62dc2d019d 100644 --- a/plugins/HistoryPlusPlus/historypp.dpr +++ b/plugins/HistoryPlusPlus/historypp.dpr @@ -347,7 +347,7 @@ begin exit;
end;
- szProto := Proto_GetProtoName(wParam);
+ szProto := Proto_GetBaseAccountName(wParam);
if (StrComp(cws.szModule, 'CList') <> 0) and
((szProto = nil) or (StrComp(cws.szModule, szProto) <> 0)) then
exit;
diff --git a/plugins/HistoryPlusPlus/hpp_contacts.pas b/plugins/HistoryPlusPlus/hpp_contacts.pas index d82eff0d83..b66db1d2f2 100644 --- a/plugins/HistoryPlusPlus/hpp_contacts.pas +++ b/plugins/HistoryPlusPlus/hpp_contacts.pas @@ -68,16 +68,16 @@ uses hpp_database, hpp_options; function GetContactProto(hContact: TMCONTACT): AnsiString;
begin
- Result := Proto_GetProtoName(hContact);
+ Result := Proto_GetBaseAccountName(hContact);
end;
function GetContactProto(hContact: TMCONTACT; var SubContact: TMCONTACT; var SubProtocol: AnsiString): AnsiString;
begin
- Result := Proto_GetProtoName(hContact);
+ Result := Proto_GetBaseAccountName(hContact);
if (Result = META_PROTO) then
begin
SubContact := db_mc_getMostOnline(hContact);
- SubProtocol := Proto_GetProtoName(SubContact);
+ SubProtocol := Proto_GetBaseAccountName(SubContact);
end
else
begin
diff --git a/plugins/HistoryStats/src/main.cpp b/plugins/HistoryStats/src/main.cpp index 1683788a1b..a3fc660c42 100644 --- a/plugins/HistoryStats/src/main.cpp +++ b/plugins/HistoryStats/src/main.cpp @@ -201,9 +201,9 @@ static INT_PTR MenuHistoryPaste(WPARAM wParam, LPARAM lParam) // ask user if this is really what he wants
ext::string strConfirm = ext::str(ext::kformat(TranslateT("You're going to copy the complete history of #{source_name} (#{source_proto}) to #{target_name} (#{target_proto}). Afterwards, the target history will contain entries from both histories. There is no way to revert this operation. Be careful! This is a rather big operation and has the potential to damage your database. Be sure to have a backup of this database before performing this operation.\r\n\r\nAre you sure you would like to continue?")))
% L"#{source_name}" * mu::clist::getContactDisplayName(g_hHistoryCopyContact)
- % L"#{source_proto}" * utils::fromA(GetContactProto(g_hHistoryCopyContact))
+ % L"#{source_proto}" * utils::fromA(Proto_GetBaseAccountName(g_hHistoryCopyContact))
% L"#{target_name}" * mu::clist::getContactDisplayName(hTarget)
- % L"#{target_proto}" * utils::fromA(GetContactProto(hTarget)));
+ % L"#{target_proto}" * utils::fromA(Proto_GetBaseAccountName(hTarget)));
if (MessageBox(0, strConfirm.c_str(), TranslateT("HistoryStats - Confirm")), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2) != IDYES)
{
@@ -270,7 +270,7 @@ static int EventPreBuildContactMenu(WPARAM hContact, LPARAM) {
if (hContact)
{
- const char* szProto = GetContactProto(hContact);
+ const char* szProto = Proto_GetBaseAccountName(hContact);
if ((!g_pSettings->m_ShowContactMenuPseudo && (!szProto || !(mu::protosvc::getCaps(szProto, PFLAGNUM_2) & ~mu::protosvc::getCaps(szProto, PFLAGNUM_5)))) || g_pSettings->m_HideContactMenuProtos.find(szProto) != g_pSettings->m_HideContactMenuProtos.end())
Menu_ShowItem(g_hMenuToggleExclude, false);
diff --git a/plugins/HistoryStats/src/mirandahistory.cpp b/plugins/HistoryStats/src/mirandahistory.cpp index e2488cc4ee..63a6c84ab9 100644 --- a/plugins/HistoryStats/src/mirandahistory.cpp +++ b/plugins/HistoryStats/src/mirandahistory.cpp @@ -60,7 +60,7 @@ void MirandaHistory::readContacts() for (auto &hContact : Contacts()) {
db.setContact(hContact);
- const char* pProtoName = GetContactProto(hContact);
+ const char* pProtoName = Proto_GetBaseAccountName(hContact);
// ignore because of bad or not loaded protocol?
if (!pProtoName)
diff --git a/plugins/IEView/src/HTMLBuilder.cpp b/plugins/IEView/src/HTMLBuilder.cpp index 5ec5978cb1..e6feba005d 100644 --- a/plugins/IEView/src/HTMLBuilder.cpp +++ b/plugins/IEView/src/HTMLBuilder.cpp @@ -109,7 +109,7 @@ const char* HTMLBuilder::getRealProto(MCONTACT hContact) if (hContact == NULL)
return nullptr;
- return GetContactProto(getRealContact(hContact));
+ return Proto_GetBaseAccountName(getRealContact(hContact));
}
MCONTACT HTMLBuilder::getRealContact(MCONTACT hContact)
@@ -192,7 +192,7 @@ void HTMLBuilder::appendEventOld(IEView *view, IEVIEWEVENT *event) MEVENT hDbEvent = event->hDbEventFirst;
event->hDbEventFirst = NULL;
- const char *szProto = GetContactProto(event->hContact);
+ const char *szProto = Proto_GetBaseAccountName(event->hContact);
IEVIEWEVENT newEvent = {};
newEvent.iType = IEE_LOG_MEM_EVENTS;
@@ -339,7 +339,7 @@ void HTMLBuilder::clear(IEView *view, IEVIEWEVENT *event) if (event != nullptr) {
setLastIEViewEvent(event);
- if (event->hContact == NULL || GetContactProto(lastIEViewEvent.hContact))
+ if (event->hContact == NULL || Proto_GetBaseAccountName(lastIEViewEvent.hContact))
buildHead(view, &lastIEViewEvent);
}
}
diff --git a/plugins/IEView/src/TemplateHTMLBuilder.cpp b/plugins/IEView/src/TemplateHTMLBuilder.cpp index df46c30801..91ec9309ff 100644 --- a/plugins/IEView/src/TemplateHTMLBuilder.cpp +++ b/plugins/IEView/src/TemplateHTMLBuilder.cpp @@ -120,7 +120,7 @@ void TemplateHTMLBuilder::buildHeadTemplate(IEView *view, IEVIEWEVENT *event, Pr char *szStatusMsg = nullptr;
MCONTACT hRealContact = getRealContact(event->hContact);
- const char *szRealProto = GetContactProto(hRealContact);
+ const char *szRealProto = Proto_GetBaseAccountName(hRealContact);
TemplateMap *tmpm = getTemplateMap(protoSettings);
if (tmpm == nullptr)
@@ -285,8 +285,8 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event, bool isGrouping = false;
MCONTACT hRealContact = getRealContact(event->hContact);
- const char *szRealProto = GetContactProto(hRealContact);
- const char *szProto = GetContactProto(event->hContact);
+ const char *szRealProto = Proto_GetBaseAccountName(hRealContact);
+ const char *szProto = Proto_GetBaseAccountName(event->hContact);
tempBase[0] = '\0';
TemplateMap *tmpm = getTemplateMap(protoSettings);
diff --git a/plugins/IEView/src/TextToken.cpp b/plugins/IEView/src/TextToken.cpp index 21c2e8452d..f5956261e9 100644 --- a/plugins/IEView/src/TextToken.cpp +++ b/plugins/IEView/src/TextToken.cpp @@ -291,7 +291,7 @@ TextToken* TextToken::tokenizeSmileys(MCONTACT hContact, const wchar_t *text, bo SMADD_BATCHPARSE2 sp;
sp.cbSize = sizeof(sp);
- sp.Protocolname = GetContactProto(hContact);
+ sp.Protocolname = Proto_GetBaseAccountName(hContact);
sp.flag = SAFL_PATH | SAFL_UNICODE | (isSent ? SAFL_OUTGOING : 0);
sp.wstr = (wchar_t *)text;
sp.hContact = hContact;
diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp index b0edaa5298..54129a9134 100644 --- a/plugins/Import/src/import.cpp +++ b/plugins/Import/src/import.cpp @@ -408,7 +408,7 @@ bool CImportBatch::ImportAccounts(OBJLIST<char> &arSkippedModules) else {
AccountMap *pNew = new AccountMap("Pattern", 0, m_pPattern->wszName);
if (m_hContact)
- pNew->pa = Proto_GetAccount(GetContactProto(m_hContact));
+ pNew->pa = Proto_GetAccount(Proto_GetBaseAccountName(m_hContact));
m_accounts.insert(pNew);
bNeedManualMerge = pNew->pa == nullptr;
diff --git a/plugins/KeyboardNotify/src/ignore.cpp b/plugins/KeyboardNotify/src/ignore.cpp index 878b9a4d8c..b37b664763 100644 --- a/plugins/KeyboardNotify/src/ignore.cpp +++ b/plugins/KeyboardNotify/src/ignore.cpp @@ -174,7 +174,7 @@ static void SetAllContactIcons(HWND hwndList) for (auto &hContact : Contacts()) {
HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, hContact, 0);
if(hItem && SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(IGNOREEVENT_MAX, 0)) == EMPTY_EXTRA_ICON) {
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if(szProto == nullptr)
protoCaps = 0;
else
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index df7766cb16..fcbb94a66a 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -194,7 +194,7 @@ DBEVENTINFO createMsgEventInfo(MCONTACT hContact) {
DBEVENTINFO einfo = {};
einfo.eventType = EVENTTYPE_MESSAGE;
- einfo.szModule = GetContactProto(hContact);
+ einfo.szModule = Proto_GetBaseAccountName(hContact);
return einfo;
}
@@ -231,7 +231,7 @@ BOOL metaCheckProtocol(const char *szProto, MCONTACT hContact, WORD eventType) if (bMetaProtoEnabled && szProto && !mir_strcmp(META_PROTO, szProto))
if (hSubContact = db_mc_getMostOnline(hContact))
- szProto = GetContactProto(hSubContact);
+ szProto = Proto_GetBaseAccountName(hSubContact);
return checkProtocol(szProto) && checkIgnore(hSubContact ? hSubContact : hContact, eventType);
}
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp index 187b2b4cf1..2cd1c94653 100644 --- a/plugins/ListeningTo/src/listeningto.cpp +++ b/plugins/ListeningTo/src/listeningto.cpp @@ -179,7 +179,7 @@ int ModulesLoaded(WPARAM, LPARAM) EnableDisablePlayers();
for (auto &hContact : Contacts()) {
- char *proto = GetContactProto(hContact);
+ char *proto = Proto_GetBaseAccountName(hContact);
if (proto != nullptr) {
DBVARIANT dbv;
if (!db_get_ws(hContact, proto, "ListeningTo", &dbv)) {
@@ -806,7 +806,7 @@ int SettingChanged(WPARAM hContact, LPARAM lParam) if (strcmp(cws->szSetting, "ListeningTo") != 0)
return 0;
- char *proto = GetContactProto(hContact);
+ char *proto = Proto_GetBaseAccountName(hContact);
if (proto == nullptr || strcmp(cws->szModule, proto) != 0)
return 0;
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index f758cf7c81..b4bc23b215 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -234,7 +234,7 @@ void CopyToClipboard(const wchar_t *pwszMsg) BOOL isMetaContact(MCONTACT hContact)
{
- char *proto = GetContactProto(hContact);
+ char *proto = Proto_GetBaseAccountName(hContact);
if (mir_strcmp(proto, META_PROTO) == 0)
return TRUE;
@@ -277,7 +277,7 @@ int StatusMsgExists(MCONTACT hContact) char par[32];
BOOL ret = 0;
- LPSTR module = GetContactProto(hContact);
+ LPSTR module = Proto_GetBaseAccountName(hContact);
if (!module) return 0;
for (auto &it : statusMsg) {
@@ -298,7 +298,7 @@ int StatusMsgExists(MCONTACT hContact) BOOL IPExists(MCONTACT hContact)
{
- LPSTR szProto = GetContactProto(hContact);
+ LPSTR szProto = Proto_GetBaseAccountName(hContact);
if (!szProto) return 0;
DWORD mIP = db_get_dw(hContact, szProto, "IP", 0);
@@ -309,7 +309,7 @@ BOOL IPExists(MCONTACT hContact) BOOL MirVerExists(MCONTACT hContact)
{
- LPSTR szProto = GetContactProto(hContact);
+ LPSTR szProto = Proto_GetBaseAccountName(hContact);
if (!szProto)
return 0;
@@ -319,7 +319,7 @@ BOOL MirVerExists(MCONTACT hContact) LPWSTR getMirVer(MCONTACT hContact)
{
- LPSTR szProto = GetContactProto(hContact);
+ LPSTR szProto = Proto_GetBaseAccountName(hContact);
if (!szProto) return nullptr;
LPWSTR msg = db_get_wsa(hContact, szProto, "MirVer");
@@ -362,7 +362,7 @@ static BOOL isProtoOnline(char *szProto) static INT_PTR onSetInvis(WPARAM wparam, LPARAM)
{
MCONTACT hContact = (MCONTACT)wparam;
- ProtoChainSend(hContact, PSS_SETAPPARENTMODE, (db_get_w(hContact, GetContactProto(hContact), "ApparentMode", 0) == ID_STATUS_OFFLINE) ? 0 : ID_STATUS_OFFLINE, 0);
+ ProtoChainSend(hContact, PSS_SETAPPARENTMODE, (db_get_w(hContact, Proto_GetBaseAccountName(hContact), "ApparentMode", 0) == ID_STATUS_OFFLINE) ? 0 : ID_STATUS_OFFLINE, 0);
return 0;
}
@@ -370,7 +370,7 @@ static INT_PTR onSetInvis(WPARAM wparam, LPARAM) static INT_PTR onSetVis(WPARAM wparam, LPARAM)
{
MCONTACT hContact = (MCONTACT)wparam;
- ProtoChainSend(hContact, PSS_SETAPPARENTMODE, (db_get_w(hContact, GetContactProto(hContact), "ApparentMode", 0) == ID_STATUS_ONLINE) ? 0 : ID_STATUS_ONLINE, 0);
+ ProtoChainSend(hContact, PSS_SETAPPARENTMODE, (db_get_w(hContact, Proto_GetBaseAccountName(hContact), "ApparentMode", 0) == ID_STATUS_ONLINE) ? 0 : ID_STATUS_ONLINE, 0);
return 0;
}
@@ -400,7 +400,7 @@ static void ModifyCopyID(MCONTACT hContact, BOOL bShowID, BOOL bTrimID) hContact = hC;
}
- LPSTR szProto = GetContactProto(hContact);
+ LPSTR szProto = Proto_GetBaseAccountName(hContact);
if (!szProto) {
Menu_ShowItem(hmenuCopyID, false);
return;
@@ -434,7 +434,7 @@ static void ModifyCopyID(MCONTACT hContact, BOOL bShowID, BOOL bTrimID) static void ModifyStatusMsg(MCONTACT hContact)
{
- LPSTR szProto = GetContactProto(hContact);
+ LPSTR szProto = Proto_GetBaseAccountName(hContact);
if (!szProto) {
Menu_ShowItem(hmenuStatusMsg, false);
return;
@@ -453,7 +453,7 @@ static void ModifyStatusMsg(MCONTACT hContact) static void ModifyCopyIP(MCONTACT hContact)
{
- LPSTR szProto = GetContactProto(hContact);
+ LPSTR szProto = Proto_GetBaseAccountName(hContact);
if (!szProto) {
Menu_ShowItem(hmenuCopyIP, false);
return;
@@ -494,7 +494,7 @@ static INT_PTR onCopyID(WPARAM hContact, LPARAM) hContact = hC;
}
- LPSTR szProto = GetContactProto(hContact);
+ LPSTR szProto = Proto_GetBaseAccountName(hContact);
if (szProto == nullptr)
return 0;
@@ -521,7 +521,7 @@ static INT_PTR onCopyStatusMsg(WPARAM hContact, LPARAM) {
DWORD flags = g_plugin.getDword("flags", vf_default);
- LPSTR module = GetContactProto(hContact);
+ LPSTR module = Proto_GetBaseAccountName(hContact);
if (!module)
return 0;
@@ -555,7 +555,7 @@ static INT_PTR onCopyStatusMsg(WPARAM hContact, LPARAM) static INT_PTR onCopyIP(WPARAM hContact, LPARAM)
{
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
CMStringW wszBuffer;
DWORD mIP = db_get_dw(hContact, szProto, "IP", 0);
@@ -602,7 +602,7 @@ static INT_PTR onRecvFiles(WPARAM hContact, LPARAM) static INT_PTR onChangeProto(WPARAM hContact, LPARAM lparam)
{
- char *szOldProto = GetContactProto(hContact);
+ char *szOldProto = Proto_GetBaseAccountName(hContact);
char *szNewProto = (char *)lparam;
if (!mir_strcmp(szOldProto, szNewProto))
return 0;
@@ -684,7 +684,7 @@ static int BuildMenu(WPARAM wparam, LPARAM) int j = 0, all = 0, hide = 0;
BOOL bIsOnline = FALSE, bShowAll = CTRL_IS_PRESSED;
MCONTACT hContact = (MCONTACT)wparam;
- char* pszProto = GetContactProto(hContact);
+ char* pszProto = Proto_GetBaseAccountName(hContact);
PROTOACCOUNT *pa = Proto_GetAccount(pszProto);
bIsOnline = isProtoOnline(pszProto);
@@ -760,7 +760,7 @@ static int BuildMenu(WPARAM wparam, LPARAM) if ((bShowAll || (flags & VF_VS)) && pszProto) {
INT_PTR caps = CallProtoService(pszProto, PS_GETCAPS, PFLAGNUM_1, 0);
- int apparent = db_get_w(hContact, GetContactProto(hContact), "ApparentMode", 0);
+ int apparent = db_get_w(hContact, Proto_GetBaseAccountName(hContact), "ApparentMode", 0);
Menu_ShowItem(hmenuVis, (caps & PF1_VISLIST) != 0);
if (caps & PF1_VISLIST)
diff --git a/plugins/MessageState/src/utils.cpp b/plugins/MessageState/src/utils.cpp index ca4c028ef8..e8006141a3 100644 --- a/plugins/MessageState/src/utils.cpp +++ b/plugins/MessageState/src/utils.cpp @@ -13,5 +13,5 @@ time_t GetLastSentMessageTime(MCONTACT hContact) bool HasUnread(MCONTACT hContact)
{
- return (CheckProtoSupport(GetContactProto(hContact))) && ((GetLastSentMessageTime(hContact) > g_plugin.getDword(hContact, DBKEY_MESSAGE_READ_TIME, 0)) && g_plugin.getDword(hContact, DBKEY_MESSAGE_READ_TIME, 0) != 0);
+ return (CheckProtoSupport(Proto_GetBaseAccountName(hContact))) && ((GetLastSentMessageTime(hContact) > g_plugin.getDword(hContact, DBKEY_MESSAGE_READ_TIME, 0)) && g_plugin.getDword(hContact, DBKEY_MESSAGE_READ_TIME, 0) != 0);
}
diff --git a/plugins/MirFox/src/MirandaUtils.cpp b/plugins/MirFox/src/MirandaUtils.cpp index 61db5b1b9f..9d200955f8 100644 --- a/plugins/MirFox/src/MirandaUtils.cpp +++ b/plugins/MirFox/src/MirandaUtils.cpp @@ -146,7 +146,7 @@ void MirandaUtils::sendMessage(ActionThreadArgStruct* args, MFENUM_SEND_MESSAGE_ // targetHandleSzProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hSubContact, 0);
// }
- char *targetHandleSzProto = GetContactProto((UINT_PTR)args->targetHandle); //targetHandleSzProto doesnt need mir_free or delete
+ char *targetHandleSzProto = Proto_GetBaseAccountName((UINT_PTR)args->targetHandle); //targetHandleSzProto doesnt need mir_free or delete
if (targetHandleSzProto == nullptr) {
logger->log(L"MirandaUtils::sendMessageToContact: ERROR targetHandleSzProto == NULL");
return;
diff --git a/plugins/MirLua/src/Modules/m_message.cpp b/plugins/MirLua/src/Modules/m_message.cpp index b1e562b5dc..5c847d5194 100644 --- a/plugins/MirLua/src/Modules/m_message.cpp +++ b/plugins/MirLua/src/Modules/m_message.cpp @@ -26,7 +26,7 @@ static int message_Send(lua_State *L) INT_PTR res = 1; - const char *szProto = GetContactProto(hContact); + const char *szProto = Proto_GetBaseAccountName(hContact); if (db_get_b(hContact, szProto, "ChatRoom", 0) == TRUE) { ptrW wszChatRoom(db_get_wsa(hContact, szProto, "ChatRoomID")); ptrW wszMessage(mir_utf8decodeW(message)); diff --git a/plugins/MirLua/src/Modules/m_protocols.cpp b/plugins/MirLua/src/Modules/m_protocols.cpp index d574f0679d..a34f262780 100644 --- a/plugins/MirLua/src/Modules/m_protocols.cpp +++ b/plugins/MirLua/src/Modules/m_protocols.cpp @@ -12,7 +12,7 @@ static int lua_GetProtocol(lua_State *L) switch (lua_type(L, 1)) {
case LUA_TNUMBER:
{
- const char *szModule = GetContactProto(lua_tonumber(L, 1));
+ const char *szModule = Proto_GetBaseAccountName(lua_tonumber(L, 1));
PROTOACCOUNT *pa = Proto_GetAccount(szModule);
if (pa)
szProto = pa->szProtoName;
@@ -115,7 +115,7 @@ static int lua_GetAccount(lua_State *L) switch (lua_type(L, 1)) {
case LUA_TNUMBER:
- name = GetContactProto(lua_tonumber(L, 1));
+ name = Proto_GetBaseAccountName(lua_tonumber(L, 1));
break;
case LUA_TSTRING:
name = lua_tostring(L, 1);
@@ -194,7 +194,7 @@ static int lua_CallService(lua_State *L) switch (lua_type(L, 1)) {
case LUA_TNUMBER:
- szModule = GetContactProto(lua_tonumber(L, 1));
+ szModule = Proto_GetBaseAccountName(lua_tonumber(L, 1));
break;
case LUA_TSTRING:
szModule = lua_tostring(L, 1);
diff --git a/plugins/MirOTR/src/dbfilter.cpp b/plugins/MirOTR/src/dbfilter.cpp index 7feb81219b..3b66730d0b 100644 --- a/plugins/MirOTR/src/dbfilter.cpp +++ b/plugins/MirOTR/src/dbfilter.cpp @@ -54,7 +54,7 @@ int OnDatabaseEventPreAdd(WPARAM hContact, LPARAM lParam) if (dbei->cbBlob == 0 || dbei->pBlob == nullptr) return 0; // just to be safe - const char *proto = GetContactProto(hContact); + const char *proto = Proto_GetBaseAccountName(hContact); if (!proto) return 0; if (db_get_b(hContact, proto, "ChatRoom", 0) == 1) @@ -64,7 +64,7 @@ int OnDatabaseEventPreAdd(WPARAM hContact, LPARAM lParam) hContact = db_mc_getMostOnline(hContact); if (!hContact) return 0; - proto = GetContactProto(hContact); + proto = Proto_GetBaseAccountName(hContact); if (!proto) return 0; } diff --git a/plugins/MirOTR/src/dialogs.cpp b/plugins/MirOTR/src/dialogs.cpp index 56e7b72feb..b1c62a0c6b 100644 --- a/plugins/MirOTR/src/dialogs.cpp +++ b/plugins/MirOTR/src/dialogs.cpp @@ -37,7 +37,7 @@ static INT_PTR CALLBACK DlgSMPUpdateProc(HWND hwndDlg, UINT msg, WPARAM wParam, smp_for_contact[context->app_data].responder = data->responder; mir_free(data); - wchar_t title[512], *proto = mir_a2u(GetContactProto(hContact)); + wchar_t title[512], *proto = mir_a2u(Proto_GetBaseAccountName(hContact)); const wchar_t *name = contact_get_nameT(hContact); mir_snwprintf(title, TranslateW(LANG_SMP_PROGRESS_TITLE), name, proto); SetWindowText(hwndDlg, title); @@ -171,7 +171,7 @@ static INT_PTR CALLBACK DlgSMPResponseProc(HWND hwndDlg, UINT msg, WPARAM wParam smp_for_contact[context->app_data].oldlevel = data->oldlevel; smp_for_contact[context->app_data].responder = data->responder; - wchar_t buff[512], *proto = mir_a2u(GetContactProto(hContact)); + wchar_t buff[512], *proto = mir_a2u(Proto_GetBaseAccountName(hContact)); mir_snwprintf(buff, TranslateW(LANG_SMP_VERIFY_TITLE), contact_get_nameT(hContact), proto); mir_free(proto); SetWindowText(hwndDlg, buff); @@ -302,7 +302,7 @@ static INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam } MCONTACT hContact = (UINT_PTR)context->app_data; - wchar_t title[512], *proto = mir_a2u(GetContactProto(hContact)); + wchar_t title[512], *proto = mir_a2u(Proto_GetBaseAccountName(hContact)); mir_snwprintf(title, TranslateW(LANG_SMP_VERIFY_TITLE), contact_get_nameT(hContact), proto); mir_free(proto); SetWindowText(hwndDlg, title); diff --git a/plugins/MirOTR/src/options.cpp b/plugins/MirOTR/src/options.cpp index 33847d434f..0fa005922f 100644 --- a/plugins/MirOTR/src/options.cpp +++ b/plugins/MirOTR/src/options.cpp @@ -545,7 +545,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM lvI.mask = LVIF_TEXT | LVIF_PARAM;// | LVIF_NORECOMPUTE;// | LVIF_IMAGE; for (auto &hContact : Contacts()) { - const char *proto = GetContactProto(hContact); + const char *proto = Proto_GetBaseAccountName(hContact); if (proto && db_get_b(hContact, proto, "ChatRoom", 0) == 0 && Proto_IsProtoOnContact(hContact, MODULENAME) // ignore chatrooms && mir_strcmp(proto, META_PROTO) != 0) // and MetaContacts { @@ -752,7 +752,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w MCONTACT hContact = (UINT_PTR)fp->context->app_data; wchar_t buff[1024], hash[45]; otrl_privkey_hash_to_humanT(hash, fp->fingerprint); - PROTOACCOUNT *pa = Proto_GetAccount(GetContactProto(hContact)); + PROTOACCOUNT *pa = Proto_GetAccount(Proto_GetBaseAccountName(hContact)); mir_snwprintf(buff, TranslateW(LANG_FINGERPRINT_STILL_IN_USE), hash, contact_get_nameT(hContact), pa->tszAccountName); ShowError(buff); } @@ -782,7 +782,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w MCONTACT hContact = (UINT_PTR)it->first->context->app_data; wchar_t buff[1024], hash[45]; otrl_privkey_hash_to_humanT(hash, it->first->fingerprint); - PROTOACCOUNT *pa = Proto_GetAccount(GetContactProto(hContact)); + PROTOACCOUNT *pa = Proto_GetAccount(Proto_GetBaseAccountName(hContact)); mir_snwprintf(buff, TranslateW(LANG_FINGERPRINT_NOT_DELETED), hash, contact_get_nameT(hContact), pa->tszAccountName); ShowError(buff); } diff --git a/plugins/MirOTR/src/otr.cpp b/plugins/MirOTR/src/otr.cpp index edace0275d..1c14043963 100644 --- a/plugins/MirOTR/src/otr.cpp +++ b/plugins/MirOTR/src/otr.cpp @@ -104,7 +104,7 @@ extern "C" { void otr_gui_create_privkey(void *opdata, const char *, const char *protocol) { DEBUGOUTA("OTR_GUI_CREATE_PRIVKEY\n"); if (opdata) { - protocol = GetContactProto((UINT_PTR)opdata); + protocol = Proto_GetBaseAccountName((UINT_PTR)opdata); } if (!protocol) return; DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_GENKEYNOTIFY), nullptr, GenKeyDlgBoxProc, (LPARAM)protocol); @@ -122,7 +122,7 @@ extern "C" { DEBUGOUTA("OTR_GUI_IS_LOGGED_IN\n"); MCONTACT hContact = (UINT_PTR)opdata; if (hContact) { - WORD status = db_get_w(hContact, GetContactProto(hContact), "Status", ID_STATUS_OFFLINE); + WORD status = db_get_w(hContact, Proto_GetBaseAccountName(hContact), "Status", ID_STATUS_OFFLINE); if (status == ID_STATUS_OFFLINE) return 0; else return 1; } @@ -252,7 +252,7 @@ extern "C" { if (context && context->protocol) proto = context->protocol; else - proto = GetContactProto((UINT_PTR)opdata); + proto = Proto_GetBaseAccountName((UINT_PTR)opdata); // ugly wokaround for ICQ. ICQ protocol reports more than 7k, but in SMP this is too long. // possibly ICQ doesn't allow single words without spaces to become longer than ~2340? if (mir_strcmp("ICQ", proto) == 0 || strncmp("ICQ_", proto, 4) == 0) diff --git a/plugins/MirOTR/src/svcs_menu.cpp b/plugins/MirOTR/src/svcs_menu.cpp index 2665554707..955265ac6b 100644 --- a/plugins/MirOTR/src/svcs_menu.cpp +++ b/plugins/MirOTR/src/svcs_menu.cpp @@ -5,7 +5,7 @@ int StartOTR(MCONTACT hContact) { - const char *proto = GetContactProto(hContact); + const char *proto = Proto_GetBaseAccountName(hContact); if (!proto) return 1; // error @@ -91,7 +91,7 @@ int otr_disconnect_contact(MCONTACT hContact) if (hSub != 0) hContact = hSub; - const char *proto = GetContactProto(hContact); + const char *proto = Proto_GetBaseAccountName(hContact); if (!proto) return 1; // error @@ -183,7 +183,7 @@ int SVC_PrebuildContactMenu(WPARAM hContact, LPARAM) Menu_ShowItem(hStartItem, false); Menu_ShowItem(hStopItem, false); - const char *proto = GetContactProto(hContact); + const char *proto = Proto_GetBaseAccountName(hContact); if (!proto || db_get_b(hContact, proto, "ChatRoom", 0) == 1) return 0; @@ -192,7 +192,7 @@ int SVC_PrebuildContactMenu(WPARAM hContact, LPARAM) hContact = db_mc_getMostOnline(hContact); if (!hContact) return 0; - proto = GetContactProto(hContact); + proto = Proto_GetBaseAccountName(hContact); } INT_PTR caps = CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0); diff --git a/plugins/MirOTR/src/svcs_proto.cpp b/plugins/MirOTR/src/svcs_proto.cpp index b909e4346a..2207ea09fd 100644 --- a/plugins/MirOTR/src/svcs_proto.cpp +++ b/plugins/MirOTR/src/svcs_proto.cpp @@ -13,7 +13,7 @@ INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){ if (ccs->wParam & PREF_BYPASS_OTR) // bypass for OTR-messages return Proto_ChainSend(wParam, ccs); - char *proto = GetContactProto(ccs->hContact); + char *proto = Proto_GetBaseAccountName(ccs->hContact); if(proto && mir_strcmp(proto, META_PROTO) == 0) // bypass for metacontacts return Proto_ChainSend(wParam, ccs); @@ -85,7 +85,7 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam) if (pre->flags & PREF_BYPASS_OTR) // bypass for our inline messages return Proto_ChainRecv(wParam, ccs); - char *proto = GetContactProto(ccs->hContact); + char *proto = Proto_GetBaseAccountName(ccs->hContact); if (!proto || !ccs->hContact) return 1; //error else if(proto && mir_strcmp(proto, META_PROTO) == 0) // bypass for metacontacts diff --git a/plugins/MirOTR/src/svcs_srmm.cpp b/plugins/MirOTR/src/svcs_srmm.cpp index 1a4da8b146..9614e4b683 100644 --- a/plugins/MirOTR/src/svcs_srmm.cpp +++ b/plugins/MirOTR/src/svcs_srmm.cpp @@ -8,7 +8,7 @@ int SVC_IconPressed(WPARAM hContact, LPARAM lParam) StatusIconClickData *sicd = (StatusIconClickData *)lParam; if (mir_strcmp(sicd->szModule, MODULENAME) == 0) { - char *proto = GetContactProto(hContact); + char *proto = Proto_GetBaseAccountName(hContact); if (proto && db_get_b(hContact, proto, "ChatRoom", 0)) return 0; ShowOTRMenu(hContact, sicd->clickLocation); @@ -20,7 +20,7 @@ int SVC_IconPressed(WPARAM hContact, LPARAM lParam) // set SRMM icon status, if applicable void SetEncryptionStatus(MCONTACT hContact, TrustLevel level) { - char *proto = GetContactProto(hContact); + char *proto = Proto_GetBaseAccountName(hContact); bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0)); BBButton button = OTRButton; @@ -88,7 +88,7 @@ int SVC_ButtonsBarPressed(WPARAM w, LPARAM l) if (cbcd->dwButtonId == 0 && !mir_strcmp(cbcd->pszModule, MODULENAME)) { MCONTACT hContact = (MCONTACT)w; - char *proto = GetContactProto(hContact); + char *proto = Proto_GetBaseAccountName(hContact); if(proto && db_get_b(hContact, proto, "ChatRoom", 0)) return 0; ShowOTRMenu(hContact, cbcd->pt); diff --git a/plugins/MirOTR/src/utils.cpp b/plugins/MirOTR/src/utils.cpp index 1d0e68f4f1..fa02d254cd 100644 --- a/plugins/MirOTR/src/utils.cpp +++ b/plugins/MirOTR/src/utils.cpp @@ -10,7 +10,7 @@ void lib_cs_lock() MCONTACT find_contact(const char* userid, const char* protocol) { for (auto &hContact : Contacts()) { - const char *proto = GetContactProto(hContact); + const char *proto = Proto_GetBaseAccountName(hContact); if (proto && mir_strcmp(proto, protocol) == 0) { ptrA name(contact_get_id(hContact)); if (name && mir_strcmp(name, userid) == 0) @@ -28,7 +28,7 @@ MCONTACT find_contact(const char* userid, const char* protocol) * filled in by the application, and set *addedp to 1. */ ConnContext* otrl_context_find_miranda(OtrlUserState us, MCONTACT hContact) { - const char *proto = GetContactProto(hContact); + const char *proto = Proto_GetBaseAccountName(hContact); return otrl_context_find(us, ptrA(contact_get_id(hContact)), proto, proto, OTRL_INSTAG_BEST, 0, nullptr, nullptr, nullptr); } diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp index 0f6ea0cb75..24d0c75abe 100644 --- a/plugins/MirandaG15/src/CAppletManager.cpp +++ b/plugins/MirandaG15/src/CAppletManager.cpp @@ -551,7 +551,7 @@ void CAppletManager::HandleEvent(CEvent *pEvent) // check for protocol filters if (pEvent->hContact != NULL && pEvent->eType != EVENT_CONTACT_ADDED) { - char *szProto = GetContactProto(pEvent->hContact); + char *szProto = Proto_GetBaseAccountName(pEvent->hContact); if (szProto == nullptr || !CConfig::GetProtocolNotificationFilter(toTstring(szProto))) pEvent->bNotification = false; } @@ -639,7 +639,7 @@ void CAppletManager::FinishMessageJob(SMessageJob *pJob) list<SMessageJob*>::iterator iter = m_MessageJobs.begin(); while (iter != m_MessageJobs.end()) { if ((*iter) == pJob) { - char *szProto = GetContactProto(pJob->hContact); + char *szProto = Proto_GetBaseAccountName(pJob->hContact); tstring strProto = toTstring(szProto); CIRCConnection *pIRCCon = GetIRCConnection(strProto); @@ -703,7 +703,7 @@ void CAppletManager::SendTypingNotification(MCONTACT hContact, bool bEnable) if (!db_get_b(hContact, "SRMsg", "SupportTyping", db_get_b(0, "SRMsg", "DefaultTyping", 1))) return; - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); if (!szProto) return; @@ -733,7 +733,7 @@ MEVENT CAppletManager::SendMessageToContact(MCONTACT hContact, tstring strMessag { tstring strAscii = _A2T(toNarrowString(strMessage).c_str()); - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); tstring strProto = toTstring(szProto); CIRCConnection *pIRCCon = CAppletManager::GetInstance()->GetIRCConnection(strProto); @@ -883,7 +883,7 @@ bool CAppletManager::TranslateDBEvent(CEvent *pEvent, WPARAM hContact, LPARAM hd } if (CConfig::GetBoolSetting(NOTIFY_SHOWPROTO)) { - char *szProto = GetContactProto(pEvent->hContact); + char *szProto = Proto_GetBaseAccountName(pEvent->hContact); pEvent->strDescription = L"(" + toTstring(szProto) + L") " + pEvent->strDescription; } @@ -1015,7 +1015,7 @@ void CAppletManager::DeleteIRCHistory(MCONTACT hContact) //************************************************************************ CIRCHistory *CAppletManager::CreateIRCHistory(MCONTACT hContact, tstring strChannel) { - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); if (!szProto) return nullptr; @@ -1401,7 +1401,7 @@ int CAppletManager::HookStatusChanged(WPARAM wParam, LPARAM lParam) int iOldStatus = CAppletManager::GetInstance()->m_ContactlistScreen.GetContactStatus(Event.hContact); - char *szProto = GetContactProto(Event.hContact); + char *szProto = Proto_GetBaseAccountName(Event.hContact); tstring strProto = toTstring(szProto); CProtocolData *pProtocolData = CAppletManager::GetInstance()->GetProtocolData(toTstring(szProto)); @@ -1634,7 +1634,7 @@ int CAppletManager::HookSettingChanged(WPARAM hContact, LPARAM lParam) Event.strValue = toTstring(dbcws->value.pszVal); } else { - char *szProto = GetContactProto(Event.hContact); + char *szProto = Proto_GetBaseAccountName(Event.hContact); if (db_get_ws(Event.hContact, szProto, "Nick", &dbv)) return 0; Event.strValue = dbv.pwszVal; diff --git a/plugins/MirandaG15/src/CChatScreen.cpp b/plugins/MirandaG15/src/CChatScreen.cpp index 580d5aa024..d735218093 100644 --- a/plugins/MirandaG15/src/CChatScreen.cpp +++ b/plugins/MirandaG15/src/CChatScreen.cpp @@ -162,7 +162,7 @@ void CChatScreen::UpdateObjects() void CChatScreen::UpdateLabels()
{
tstring strNickname = CAppletManager::GetContactDisplayname(m_hContact);
- char *szProto = GetContactProto(m_hContact);
+ char *szProto = Proto_GetBaseAccountName(m_hContact);
m_iStatus = ID_STATUS_OFFLINE;
tstring strProto = L"";
@@ -213,7 +213,7 @@ bool CChatScreen::SetContact(MCONTACT hContact) }
// Check if the contact is valid
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
m_strProto = toTstring(szProto);
CIRCConnection *pIRCCon = CAppletManager::GetInstance()->GetIRCConnection(m_strProto);
@@ -249,7 +249,7 @@ void CChatScreen::LoadHistory() if (!m_hContact)
return;
- char *szProto = GetContactProto(m_hContact);
+ char *szProto = Proto_GetBaseAccountName(m_hContact);
if (m_bIRCProtocol && db_get_b(m_hContact, szProto, "ChatRoom", 0) != 0) {
if (!CAppletManager::GetInstance()->IsIRCHookEnabled()) {
diff --git a/plugins/MirandaG15/src/CContactList.cpp b/plugins/MirandaG15/src/CContactList.cpp index e50c5d57f8..06592a2ce5 100644 --- a/plugins/MirandaG15/src/CContactList.cpp +++ b/plugins/MirandaG15/src/CContactList.cpp @@ -92,7 +92,7 @@ void CContactList::AddContact(MCONTACT hContact) CListContainer<CContactListEntry*, CContactListGroup*> *pGroup = nullptr;
tstring strName = CAppletManager::GetContactDisplayname(hContact);
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
tstring strGroup = GetContactGroupPath(hContact);
// ignore contacts without a valid protocoll
@@ -191,7 +191,7 @@ bool CContactList::IsVisible(CContactListEntry *pEntry) int dwNumContacts = db_mc_getSubCount(pEntry->hHandle);
for (int i = 0; i < dwNumContacts; i++) {
MCONTACT hSubContact = db_mc_getSub(pEntry->hHandle, i);
- char *szProto = GetContactProto(hSubContact);
+ char *szProto = Proto_GetBaseAccountName(hSubContact);
if (db_get_w(hSubContact, szProto, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
return true;
}
@@ -937,7 +937,7 @@ void CContactList::InitializeGroupObjects() for (MCONTACT hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) {
tstring strGroup = GetContactGroupPath(hContact);
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto && db_get_b(0, META_PROTO, "Enabled", 1) && !mir_strcmpi(szProto, META_PROTO)) {
tstring strName = CAppletManager::GetContactDisplayname(hContact);
tstring strPath = L"";
diff --git a/plugins/MirandaG15/src/CEventScreen.cpp b/plugins/MirandaG15/src/CEventScreen.cpp index 324f508369..a298db306c 100644 --- a/plugins/MirandaG15/src/CEventScreen.cpp +++ b/plugins/MirandaG15/src/CEventScreen.cpp @@ -183,7 +183,7 @@ void CEventScreen::OnLCDButtonDown(int iButton) return;
// if the contact is an irc chatroom, check if it is hidden (user left the channel)
- char *szProto = GetContactProto(pEntry->hContact);
+ char *szProto = Proto_GetBaseAccountName(pEntry->hContact);
CIRCConnection *pIRCCon = CAppletManager::GetInstance()->GetIRCConnection(toTstring(szProto));
if (pIRCCon && db_get_b(pEntry->hContact, szProto, "ChatRoom", 0) != 0 && Contact_IsHidden(pEntry->hContact))
diff --git a/plugins/MobileState/src/main.cpp b/plugins/MobileState/src/main.cpp index 8d7e93c552..29ed1e40ae 100644 --- a/plugins/MobileState/src/main.cpp +++ b/plugins/MobileState/src/main.cpp @@ -51,7 +51,7 @@ CMPlugin::CMPlugin() : bool hasMobileClient(MCONTACT hContact, LPARAM)
{
- char *proto = GetContactProto(hContact);
+ char *proto = Proto_GetBaseAccountName(hContact);
ptrW client(db_get_wsa(hContact, proto, "MirVer"));
if (client) {
@@ -84,7 +84,7 @@ static int ExtraIconsApply(WPARAM wParam, LPARAM lParam) static int onContactSettingChanged(WPARAM wParam, LPARAM lParam)
{
- char *proto = GetContactProto(wParam);
+ char *proto = Proto_GetBaseAccountName(wParam);
if (!proto)
return 0;
diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index cec37e9e5f..531e26f690 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -79,11 +79,11 @@ int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort) return mir_wstrcmpi(Clist_GetContactDisplayName(lParam1), Clist_GetContactDisplayName(lParam2));
if (lParamSort == 2)
- return mir_strcmp(GetContactProto((MCONTACT)lParam1), GetContactProto((MCONTACT)lParam2));
+ return mir_strcmp(Proto_GetBaseAccountName((MCONTACT)lParam1), Proto_GetBaseAccountName((MCONTACT)lParam2));
if (lParamSort == 3) {
- DWORD dwUin1 = db_get_dw((MCONTACT)lParam1, GetContactProto((MCONTACT)lParam1), "UIN", 0);
- DWORD dwUin2 = db_get_dw((MCONTACT)lParam2, GetContactProto((MCONTACT)lParam2), "UIN", 0);
+ DWORD dwUin1 = db_get_dw((MCONTACT)lParam1, Proto_GetBaseAccountName((MCONTACT)lParam1), "UIN", 0);
+ DWORD dwUin2 = db_get_dw((MCONTACT)lParam2, Proto_GetBaseAccountName((MCONTACT)lParam2), "UIN", 0);
if (dwUin1 == dwUin2)
return 0;
return (dwUin1 > dwUin2) ? -1 : 1;
@@ -473,7 +473,7 @@ public: wstring sTmp;
LVITEM sItem = { 0 };
for (auto &hContact : Contacts()) {
- PROTOACCOUNT *pa = Proto_GetAccount(GetContactProto(hContact));
+ PROTOACCOUNT *pa = Proto_GetAccount(Proto_GetBaseAccountName(hContact));
if (pa == nullptr)
continue;
diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp index 9dbba8f4e9..d9e3cc9307 100755 --- a/plugins/Msg_Export/src/utils.cpp +++ b/plugins/Msg_Export/src/utils.cpp @@ -457,7 +457,7 @@ void ReplaceDefines(MCONTACT hContact, wstring & sTarget) bool bIdentifierUsed = sTarget.find(L"%identifier%") != string::npos;
if (bUINUsed || bEMailUsed || bProtoUsed || bIdentifierUsed) {
- const char *szProto = GetContactProto(hContact);
+ const char *szProto = Proto_GetBaseAccountName(hContact);
if (bUINUsed || (bIdentifierUsed && !mir_strcmp(szProto, "ICQ"))) {
DWORD dwUIN = db_get_dw(hContact, szProto, "UIN", 0);
wstring sReplaceUin;
@@ -665,7 +665,7 @@ static bool ExportDBEventInfo(MCONTACT hContact, HANDLE hFile, wstring sFilePath wchar_t szTemp[500];
bool bWriteUTF8Format = false;
- const char *szProto = GetContactProto(hContact);
+ const char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto == nullptr) {
Netlib_Logf(0, MODULENAME ": cannot write message for a contact %d without protocol", hContact);
return false;
@@ -949,7 +949,7 @@ bool bIsExportEnabled(MCONTACT hContact) if (!g_plugin.getByte(hContact, "EnableLog", 1))
return false;
- const char *szProto = GetContactProto(hContact);
+ const char *szProto = Proto_GetBaseAccountName(hContact);
char szTemp[500];
mir_snprintf(szTemp, "DisableProt_%s", szProto);
if (!g_plugin.getByte(szTemp, 1))
@@ -1130,6 +1130,6 @@ int nContactDeleted(WPARAM hContact, LPARAM) wchar_t* GetMyOwnNick(MCONTACT hContact)
{
- wchar_t *p = Contact_GetInfo(CNF_DISPLAY, NULL, GetContactProto(hContact));
+ wchar_t *p = Contact_GetInfo(CNF_DISPLAY, NULL, Proto_GetBaseAccountName(hContact));
return (p != nullptr) ? p : mir_wstrdup(TranslateT("No_Nick"));
}
diff --git a/plugins/NewAwaySysMod/src/AwayOpt.cpp b/plugins/NewAwaySysMod/src/AwayOpt.cpp index 66c463d752..9bcca8f929 100644 --- a/plugins/NewAwaySysMod/src/AwayOpt.cpp +++ b/plugins/NewAwaySysMod/src/AwayOpt.cpp @@ -904,7 +904,7 @@ INT_PTR CALLBACK ContactsOptDlg(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam) hItemUnknown = (HANDLE)SendMessage(hwndList, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
for (auto &hContact : Contacts()) {
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto) {
int Flag1 = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0);
if ((Flag1 & PF1_IM) != PF1_IM && !(Flag1 & PF1_INDIVMODEMSG)) // does contact's protocol supports message sending/receiving or individual status messages?
diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp index 596f77e72f..a0641ae1c2 100644 --- a/plugins/NewAwaySysMod/src/AwaySys.cpp +++ b/plugins/NewAwaySysMod/src/AwaySys.cpp @@ -108,7 +108,7 @@ TCString GetDynamicStatMsg(MCONTACT hContact, char *szProto, DWORD UIN, int iSta VarParseData.Message = CProtoSettings(szProto, iStatus).GetMsgFormat(iStatus ? GMF_LASTORDEFAULT : GMF_ANYCURRENT);
TCString sTime;
- VarParseData.szProto = szProto ? szProto : ((hContact && hContact != INVALID_CONTACT_ID) ? GetContactProto(hContact) : nullptr);
+ VarParseData.szProto = szProto ? szProto : ((hContact && hContact != INVALID_CONTACT_ID) ? Proto_GetBaseAccountName(hContact) : nullptr);
VarParseData.UIN = UIN;
VarParseData.Flags = 0;
if (ServiceExists(MS_VARS_FORMATSTRING) && !g_SetAwayMsgPage.GetDBValueCopy(IDS_SAWAYMSG_DISABLEVARIABLES)) {
@@ -227,7 +227,7 @@ static int IdleChangeEvent(WPARAM, LPARAM lParam) int PreBuildContactMenu(WPARAM hContact, LPARAM)
{
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
int iMode = szProto ? Proto_GetStatus(szProto) : 0;
int Flag1 = szProto ? CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) : 0;
int iContactMode = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
@@ -302,7 +302,7 @@ static INT_PTR SetContactStatMsg(WPARAM hContact, LPARAM) SetAwayMsgData *dat = new SetAwayMsgData;
memset(dat, 0, sizeof(SetAwayMsgData));
dat->hInitContact = hContact;
- dat->szProtocol = GetContactProto(hContact);
+ dat->szProtocol = Proto_GetBaseAccountName(hContact);
dat->IsModeless = false;
DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_SETAWAYMSG), nullptr, SetAwayMsgDlgProc, (LPARAM)dat);
return 0;
@@ -311,7 +311,7 @@ static INT_PTR SetContactStatMsg(WPARAM hContact, LPARAM) INT_PTR ToggleSendOnEvent(WPARAM hContact, LPARAM)
{
// used only for the global setting
- CContactSettings(g_ProtoStates[hContact ? GetContactProto(hContact) : nullptr].m_status, hContact).Autoreply.Toggle();
+ CContactSettings(g_ProtoStates[hContact ? Proto_GetBaseAccountName(hContact) : nullptr].m_status, hContact).Autoreply.Toggle();
if (hContact == NULL) {
int SendOnEvent = CContactSettings(g_ProtoStates[(LPSTR)NULL].m_status).Autoreply;
@@ -330,19 +330,19 @@ INT_PTR ToggleSendOnEvent(WPARAM hContact, LPARAM) INT_PTR srvAutoreplyOn(WPARAM hContact, LPARAM)
{
- CContactSettings(g_ProtoStates[GetContactProto(hContact)].m_status, hContact).Autoreply = 1;
+ CContactSettings(g_ProtoStates[Proto_GetBaseAccountName(hContact)].m_status, hContact).Autoreply = 1;
return 0;
}
INT_PTR srvAutoreplyOff(WPARAM hContact, LPARAM)
{
- CContactSettings(g_ProtoStates[GetContactProto(hContact)].m_status, hContact).Autoreply = 0;
+ CContactSettings(g_ProtoStates[Proto_GetBaseAccountName(hContact)].m_status, hContact).Autoreply = 0;
return 0;
}
INT_PTR srvAutoreplyUseDefault(WPARAM hContact, LPARAM)
{
- CContactSettings(g_ProtoStates[GetContactProto(hContact)].m_status, hContact).Autoreply = VAL_USEDEFAULT;
+ CContactSettings(g_ProtoStates[Proto_GetBaseAccountName(hContact)].m_status, hContact).Autoreply = VAL_USEDEFAULT;
return 0;
}
diff --git a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp index 8cc39f69e8..ff4d1c35d4 100644 --- a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp +++ b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp @@ -53,7 +53,7 @@ void __cdecl AutoreplyDelayThread(CAutoreplyData *ad) Thread_SetName("NewAwaySysMod: AutoreplyDelayThread");
_ASSERT(ad && ad->hContact && ad->Reply.GetLen());
- char *szProto = GetContactProto(ad->hContact);
+ char *szProto = Proto_GetBaseAccountName(ad->hContact);
if (!szProto) {
_ASSERT(0);
return;
@@ -116,7 +116,7 @@ int MsgEventAdded(WPARAM hContact, LPARAM lParam) if (time(0) - dbei->timestamp > MAX_REPLY_TIMEDIFF) // don't reply to offline messages
return 0;
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (!szProto)
return 0;
diff --git a/plugins/NewAwaySysMod/src/Properties.cpp b/plugins/NewAwaySysMod/src/Properties.cpp index e4e1e2b22d..0e13472bf0 100644 --- a/plugins/NewAwaySysMod/src/Properties.cpp +++ b/plugins/NewAwaySysMod/src/Properties.cpp @@ -36,7 +36,7 @@ void ResetSettingsOnStatusChange(const char *szProto = nullptr, int bResetPerson for (auto &hContact : Contacts()) {
const char *szCurProto;
- if (!szProto || ((szCurProto = GetContactProto(hContact)) && !mir_strcmp(szProto, szCurProto))) {
+ if (!szProto || ((szCurProto = Proto_GetBaseAccountName(hContact)) && !mir_strcmp(szProto, szCurProto))) {
ResetContactSettingsOnStatusChange(hContact);
if (bResetPersonalMsgs)
CContactSettings(Status, hContact).SetMsgFormat(SMF_PERSONAL, nullptr); // TODO: delete only when SAM dialog opens?
@@ -135,7 +135,7 @@ TCString CContactSettings::GetMsgFormat(int Flags, int *pOrder, char *szProtoOve Message = db_get_s(m_hContact, MODULENAME, StatusToDBSetting(Status, DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPERSONAL), (wchar_t*)NULL);
if (Flags & (GMF_LASTORDEFAULT | GMF_PROTOORGLOBAL | GMF_TEMPORARY) && Message.IsEmpty()) {
- char *szProto = szProtoOverride ? szProtoOverride : (m_hContact ? GetContactProto(m_hContact) : nullptr);
+ char *szProto = szProtoOverride ? szProtoOverride : (m_hContact ? Proto_GetBaseAccountName(m_hContact) : nullptr);
// we mustn't pass here by GMF_TEMPORARY flag, as otherwise we'll handle GMF_TEMPORARY | GMF_PERSONAL combination incorrectly,
// which is supposed to get only per-contact messages, and at the same time also may be used with NULL contact to get the global status message
diff --git a/plugins/NewAwaySysMod/src/Properties.h b/plugins/NewAwaySysMod/src/Properties.h index 09790acdb5..3dca12f34d 100644 --- a/plugins/NewAwaySysMod/src/Properties.h +++ b/plugins/NewAwaySysMod/src/Properties.h @@ -455,7 +455,7 @@ public: _ASSERT((Parent->m_hContact && Parent->m_hContact != INVALID_CONTACT_ID) || szProtoOverride); // we need either correct protocol or a correct hContact to determine its protocol
int m_value = *this;
if (m_value == VAL_USEDEFAULT) {
- const char *szProto = (Parent->m_hContact && Parent->m_hContact != INVALID_CONTACT_ID) ? GetContactProto(Parent->m_hContact) : szProtoOverride;
+ const char *szProto = (Parent->m_hContact && Parent->m_hContact != INVALID_CONTACT_ID) ? Proto_GetBaseAccountName(Parent->m_hContact) : szProtoOverride;
return CProtoSettings(szProto).Autoreply.IncludingParents();
}
return m_value;
@@ -483,7 +483,7 @@ public: {
if (!Status) {
_ASSERT(m_hContact != INVALID_CONTACT_ID);
- char *szProto = m_hContact ? GetContactProto(m_hContact) : nullptr;
+ char *szProto = m_hContact ? Proto_GetBaseAccountName(m_hContact) : nullptr;
Status = (szProto || !m_hContact) ? g_ProtoStates[szProto].m_status : ID_STATUS_AWAY;
}
return Status;
diff --git a/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp b/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp index 71108da370..241d1777d0 100644 --- a/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp +++ b/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp @@ -64,7 +64,7 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam wchar_t str[256], format[128];
wchar_t *contactName = Clist_GetContactDisplayName(awayData->hContact);
- char *szProto = GetContactProto(awayData->hContact);
+ char *szProto = Proto_GetBaseAccountName(awayData->hContact);
wchar_t *status = Clist_GetStatusModeDescription(db_get_w(awayData->hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
GetWindowText(hwndDlg, format, _countof(format));
mir_snwprintf(str, format, status, contactName);
diff --git a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp index db8c03f9f8..33ea5908cf 100644 --- a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp +++ b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp @@ -479,7 +479,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA g_SetAwayMsgPage.SetWnd(hwndDlg);
g_SetAwayMsgPage.DBToMemToPage();
- char *szProto = dat->hInitContact ? GetContactProto(dat->hInitContact) : dat->szProtocol;
+ char *szProto = dat->hInitContact ? Proto_GetBaseAccountName(dat->hInitContact) : dat->szProtocol;
int Status = 0;
Status = g_ProtoStates[dat->szProtocol].m_status;
@@ -559,7 +559,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA // init message tree
if (g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_RECENTMSGSCOUNT) && g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_PERSTATUSMRM)) {
- char *szInitProto = dat->hInitContact ? GetContactProto(dat->hInitContact) : dat->szProtocol;
+ char *szInitProto = dat->hInitContact ? Proto_GetBaseAccountName(dat->hInitContact) : dat->szProtocol;
int ID = GetRecentGroupID((szInitProto || !dat->hInitContact) ? g_ProtoStates[szInitProto].m_status : ID_STATUS_AWAY);
CBaseTreeItem* pTreeItem = MsgTree->GetNextItem(MTGN_CHILD | MTGN_BYID, (CBaseTreeItem*)g_Messages_RecentRootID);
while (pTreeItem) {
@@ -712,7 +712,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (ItemType == MCLCIT_CONTACT) {
hContact = CList->GethContact(hItem);
_ASSERT(hContact);
- szProto = GetContactProto(hContact);
+ szProto = Proto_GetBaseAccountName(hContact);
_ASSERT(szProto);
}
else if (ItemType == MCLCIT_INFO)
@@ -865,7 +865,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA CList->SetRedraw(false);
for (auto &hContact : Contacts()) {
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto) {
int Flag1 = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0);
if ((Flag1 & PF1_IM) == PF1_IM || Flag1 & PF1_INDIVMODEMSG) { // check if the protocol supports message sending/receiving or individual status messages before adding this contact
diff --git a/plugins/NewXstatusNotify/src/indsnd.cpp b/plugins/NewXstatusNotify/src/indsnd.cpp index ba3d8cedc7..3c196a4d4e 100644 --- a/plugins/NewXstatusNotify/src/indsnd.cpp +++ b/plugins/NewXstatusNotify/src/indsnd.cpp @@ -112,7 +112,7 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA TranslateDialogDefault(hwndDlg);
{
hContact = lParam;
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
ListView_SetImageList(hList, GetStatusIconsImgList(szProto), LVSIL_SMALL);
ListView_SetExtendedListViewStyleEx(hList, LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP, LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP);
@@ -304,7 +304,7 @@ void SetAllContactsIcons(HWND hwndList) for (auto &hContact : Contacts()) {
HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, hContact, 0);
if (hItem) {
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto) {
EnableSounds = g_plugin.getByte(hContact, "EnableSounds", 1);
EnablePopups = g_plugin.getByte(hContact, "EnablePopups", 1);
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index ab6f591208..0da90707e8 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -79,7 +79,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_USERON BYTE GetGender(MCONTACT hContact)
{
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto) {
switch (db_get_b(hContact, szProto, "Gender", 0)) {
case 'M':
@@ -374,12 +374,12 @@ int ContactStatusChanged(MCONTACT hContact, WORD oldStatus, WORD newStatus) }
bool bEnablePopup = true, bEnableSound = true;
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
int myStatus = Proto_GetStatus(szProto);
if (!mir_strcmp(szProto, META_PROTO)) { //this contact is Meta
MCONTACT hSubContact = db_mc_getMostOnline(hContact);
- char *szSubProto = GetContactProto(hSubContact);
+ char *szSubProto = Proto_GetBaseAccountName(hSubContact);
if (szSubProto == nullptr)
return 0;
@@ -475,7 +475,7 @@ int ProcessStatus(DBCONTACTWRITESETTING *cws, MCONTACT hContact) if (newStatus < ID_STATUS_MIN || newStatus > ID_STATUS_MAX)
return 0;
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (mir_strcmp(cws->szModule, szProto))
return 0;
@@ -518,7 +518,7 @@ int ProcessExtraStatus(DBCONTACTWRITESETTING *cws, MCONTACT hContact) {
XSTATUSCHANGE *xsc;
STATUSMSGINFO smi = { 0 };
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
smi.hContact = hContact;
if (strstr(cws->szSetting, "/mood/") || strstr(cws->szSetting, "/activity/")) { // Jabber mood or activity changed
@@ -616,7 +616,7 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) {
STATUSMSGINFO smi;
bool bEnablePopup = true, bEnableSound = true;
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
smi.proto = szProto;
smi.hContact = hContact;
@@ -778,7 +778,7 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) if (hContact == NULL)
return 0;
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto == nullptr)
return 0;
diff --git a/plugins/NewXstatusNotify/src/popup.cpp b/plugins/NewXstatusNotify/src/popup.cpp index f34743fc1e..08cb6dfd39 100644 --- a/plugins/NewXstatusNotify/src/popup.cpp +++ b/plugins/NewXstatusNotify/src/popup.cpp @@ -96,7 +96,7 @@ static int AwayMsgHook(WPARAM, LPARAM lParam, LPARAM pObj) void QueryAwayMessage(HWND hWnd, PLUGINDATA *pdp)
{
MCONTACT hContact = PUGetContact(hWnd);
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto) {
if ((CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGRECV) &&
(CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(pdp->newStatus)))
@@ -186,7 +186,7 @@ LRESULT CALLBACK PopupDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa case UM_INITPOPUP:
pdp = (PLUGINDATA *)PUGetPluginData(hwnd);
if (pdp != nullptr) {
- char *szProto = GetContactProto(PUGetContact(hwnd));
+ char *szProto = Proto_GetBaseAccountName(PUGetContact(hwnd));
if (szProto && opt.ReadAwayMsg && StatusHasAwayMessage(szProto, pdp->newStatus)) {
int myStatus = Proto_GetStatus(szProto);
if (myStatus != ID_STATUS_INVISIBLE)
diff --git a/plugins/NewXstatusNotify/src/xstatus.cpp b/plugins/NewXstatusNotify/src/xstatus.cpp index 0f13da626e..931f938336 100644 --- a/plugins/NewXstatusNotify/src/xstatus.cpp +++ b/plugins/NewXstatusNotify/src/xstatus.cpp @@ -470,7 +470,7 @@ void AddXStatusEventThread(void *arg) {
MCONTACT hContact = (MCONTACT)(DWORD_PTR)arg;
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto == nullptr)
return;
@@ -503,7 +503,7 @@ void AddSMsgEventThread(void *arg) STATUSMSGINFO smi;
smi.hContact = hContact;
- smi.proto = GetContactProto(hContact);
+ smi.proto = Proto_GetBaseAccountName(hContact);
if (smi.proto == nullptr)
return;
diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp index 0e156d8918..c11997bde9 100755 --- a/plugins/New_GPG/src/messages.cpp +++ b/plugins/New_GPG/src/messages.cpp @@ -556,7 +556,7 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) return 0; } else if (!isContactHaveKey(ccs->hContact) && globals.bAutoExchange && globals.gpg_valid && globals.gpg_keyexist) { - char *proto = GetContactProto(ccs->hContact); + char *proto = Proto_GetBaseAccountName(ccs->hContact); ptrA jid(db_get_utfa(ccs->hContact, proto, "jid", "")); if (jid[0]) { for (auto p : globals.Accounts) { @@ -843,7 +843,7 @@ int HookSendMsg(WPARAM w, LPARAM l) if (globals.bDebugLog) globals.debuglog << std::string(time_str() + ": info: checking for autoexchange possibility, name: " + toUTF8(Clist_GetContactDisplayName(hContact))); - LPSTR proto = GetContactProto(hContact); + LPSTR proto = Proto_GetBaseAccountName(hContact); ptrA jid(db_get_utfa(hContact, proto, "jid", "")); if (jid[0]) { if (globals.bDebugLog) diff --git a/plugins/New_GPG/src/options.cpp b/plugins/New_GPG/src/options.cpp index 25f4215a47..8530d04425 100755 --- a/plugins/New_GPG/src/options.cpp +++ b/plugins/New_GPG/src/options.cpp @@ -64,7 +64,7 @@ public: int row = list_USERLIST.AddItem(L"", 0); list_USERLIST.SetItemText(row, 0, name); - wchar_t *tmp = mir_a2u(GetContactProto(hContact)); + wchar_t *tmp = mir_a2u(Proto_GetBaseAccountName(hContact)); list_USERLIST.SetItemText(row, 4, tmp); mir_free(tmp); diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index ecf3610821..ac25435a73 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -115,7 +115,7 @@ INT_PTR SendKey(WPARAM w, LPARAM) char *szMessage; std::string key_id_str; { - LPSTR proto = GetContactProto(hContact); + LPSTR proto = Proto_GetBaseAccountName(hContact); PROTOACCOUNT *acc = Proto_GetAccount(proto); std::string acc_str; if (acc) { @@ -190,7 +190,7 @@ int OnPreBuildContactMenu(WPARAM w, LPARAM) MCONTACT hContact = db_mc_tryMeta(w); { CMenuItem mi2(&g_plugin); - LPSTR proto = GetContactProto(hContact); + LPSTR proto = Proto_GetBaseAccountName(hContact); PROTOACCOUNT *acc = Proto_GetAccount(proto); std::string setting; if (acc) { @@ -452,7 +452,7 @@ INT_PTR onSendFile(WPARAM w, LPARAM l) return Proto_ChainSend(w, ccs); if (isContactSecured(ccs->hContact)) { - char *proto = GetContactProto(ccs->hContact); + char *proto = Proto_GetBaseAccountName(ccs->hContact); bool cap_found = false, supported_proto = false; ptrA jid(db_get_utfa(ccs->hContact, proto, "jid", "")); if (jid[0]) { @@ -1056,7 +1056,7 @@ struct TFakeAckParams __forceinline int SendBroadcast(MCONTACT hContact, int type, int result, HANDLE hProcess, LPARAM lParam) { - return ProtoBroadcastAck(GetContactProto(hContact), hContact, type, result, hProcess, lParam); + return ProtoBroadcastAck(Proto_GetBaseAccountName(hContact), hContact, type, result, hProcess, lParam); } unsigned __stdcall sttFakeAck(void *param) @@ -1212,7 +1212,7 @@ void ExportGpGKeysFunc(int type) mir_free(k); } - const char *proto = GetContactProto(hContact); + const char *proto = Proto_GetBaseAccountName(hContact); std::string id = "Comment: login "; const char *uid = Proto_GetUniqueId(proto); DBVARIANT dbv = { 0 }; diff --git a/plugins/NoHistory/src/dllmain.cpp b/plugins/NoHistory/src/dllmain.cpp index d2a8de5f9e..bc1a257072 100644 --- a/plugins/NoHistory/src/dllmain.cpp +++ b/plugins/NoHistory/src/dllmain.cpp @@ -135,7 +135,7 @@ INT_PTR ServiceClear(WPARAM hContact, LPARAM) int PrebuildContactMenu(WPARAM hContact, LPARAM)
{
bool remove = g_plugin.getByte(hContact, DBSETTING_REMOVE) != 0;
- char *proto = GetContactProto(hContact);
+ char *proto = Proto_GetBaseAccountName(hContact);
bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0) != 0);
if (chat_room)
@@ -173,7 +173,7 @@ int WindowEvent(WPARAM, LPARAM lParam) break;
case MSG_WINDOW_EVT_OPEN:
- char *proto = GetContactProto(hContact);
+ char *proto = Proto_GetBaseAccountName(hContact);
bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0) != 0);
int remove = g_plugin.getByte(hContact, DBSETTING_REMOVE) != 0;
@@ -193,7 +193,7 @@ int IconPressed(WPARAM hContact, LPARAM lParam) if (sicd->flags & MBCF_RIGHTBUTTON) return 0; // ignore right-clicks
if (mir_strcmp(sicd->szModule, MODULENAME) != 0) return 0; // not our event
- char *proto = GetContactProto(hContact);
+ char *proto = Proto_GetBaseAccountName(hContact);
bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0) != 0);
if (!chat_room)
ServiceToggle(hContact, 0);
diff --git a/plugins/NoHistory/src/options.cpp b/plugins/NoHistory/src/options.cpp index 3107787b21..92944f174f 100644 --- a/plugins/NoHistory/src/options.cpp +++ b/plugins/NoHistory/src/options.cpp @@ -78,7 +78,7 @@ static void ResetListOptions(HWND hwndList) static void SetAllContactIcons(HWND hwndList)
{
for (auto &hContact : Contacts()) {
- char *proto = GetContactProto(hContact);
+ char *proto = Proto_GetBaseAccountName(hContact);
bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0) != 0);
if (!chat_room) {
@@ -193,7 +193,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
for (auto &hContact : Contacts()) {
- char *proto = GetContactProto(hContact);
+ char *proto = Proto_GetBaseAccountName(hContact);
bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0) != 0);
if (!chat_room) {
diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp index 4737abcf86..1112a21959 100644 --- a/plugins/Nudge/src/main.cpp +++ b/plugins/Nudge/src/main.cpp @@ -53,7 +53,7 @@ static INT_PTR NudgeShowMenu(WPARAM wParam, LPARAM lParam) static INT_PTR NudgeSend(WPARAM hContact, LPARAM lParam)
{
- char *protoName = GetContactProto(hContact);
+ char *protoName = Proto_GetBaseAccountName(hContact);
int diff = time(0) - db_get_dw(hContact, "Nudge", "LastSent", time(0) - 30);
if (diff < GlobalNudge.sendTimeSec) {
wchar_t msg[500];
@@ -92,7 +92,7 @@ void OpenContactList() static int NudgeReceived(WPARAM hContact, LPARAM lParam)
{
- char *protoName = GetContactProto(hContact);
+ char *protoName = Proto_GetBaseAccountName(hContact);
DWORD currentTimestamp = time(0);
DWORD nudgeSentTimestamp = lParam ? (DWORD)lParam : currentTimestamp;
@@ -394,7 +394,7 @@ static int TabsrmmButtonInit(WPARAM, LPARAM) void HideNudgeButton(MCONTACT hContact)
{
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (!ProtoServiceExists(szProto, PS_SEND_NUDGE)) {
BBButton bbd = {};
bbd.pszModuleName = "Nudge";
@@ -415,7 +415,7 @@ static int ContactWindowOpen(WPARAM, LPARAM lParam) static int PrebuildContactMenu(WPARAM hContact, LPARAM)
{
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto != nullptr) {
bool isChat = db_get_b(hContact, szProto, "ChatRoom", false) != 0;
NudgeShowMenu((WPARAM)szProto, !isChat);
diff --git a/plugins/PasteIt/src/PasteIt.cpp b/plugins/PasteIt/src/PasteIt.cpp index 295466b993..3160663d02 100644 --- a/plugins/PasteIt/src/PasteIt.cpp +++ b/plugins/PasteIt/src/PasteIt.cpp @@ -107,7 +107,7 @@ static void PasteIt(MCONTACT hContact, int mode) MessageBox(nullptr, pasteToWeb->error, TranslateT("Error"), MB_OK | MB_ICONERROR);
}
else if (hContact != NULL && pasteToWeb->szFileLink[0] != 0) {
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto && (INT_PTR)szProto != CALLSERVICE_NOTFOUND) {
BOOL isChat = db_get_b(hContact, szProto, "ChatRoom", 0);
if (Options::instance->autoSend) {
@@ -233,7 +233,7 @@ static int PrebuildContactMenu(WPARAM wParam, LPARAM) {
bool bIsContact = false;
- char *szProto = GetContactProto(wParam);
+ char *szProto = Proto_GetBaseAccountName(wParam);
if (szProto && (INT_PTR)szProto != CALLSERVICE_NOTFOUND)
bIsContact = (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM) != 0;
@@ -321,7 +321,7 @@ static void InitTabsrmmButton() static int WindowEvent(WPARAM, MessageWindowEventData* lParam)
{
if (lParam->uType == MSG_WINDOW_EVT_OPEN) {
- char *szProto = GetContactProto(lParam->hContact);
+ char *szProto = Proto_GetBaseAccountName(lParam->hContact);
if (szProto && (INT_PTR)szProto != CALLSERVICE_NOTFOUND) {
if (db_get_b(lParam->hContact, szProto, "ChatRoom", 0)) {
(*contactWindows)[lParam->hContact] = lParam->hwndInput;
diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp index 9a6265ac6b..6659813d6d 100644 --- a/plugins/Popup/src/popup_wnd2.cpp +++ b/plugins/Popup/src/popup_wnd2.cpp @@ -497,7 +497,7 @@ void PopupWnd2::fixDefaults() m_hContactPassed = m_hContact;
if (m_hContact)
- if (!GetContactProto(m_hContact))
+ if (!Proto_GetBaseAccountName(m_hContact))
m_hContact = NULL;
switch (m_textType) {
@@ -524,7 +524,7 @@ void PopupWnd2::fixAvatar() int PopupWnd2::fixActions(POPUPACTION *theActions, int count)
{
- bool isIm = (m_hContact && (CallProtoService(GetContactProto(m_hContact), PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM)) ? true : false;
+ bool isIm = (m_hContact && (CallProtoService(Proto_GetBaseAccountName(m_hContact), PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM)) ? true : false;
bool enableDefaultGen = (m_hContact || !(PopupOptions.actions & ACT_DEF_NOGLOBAL)) ? true : false;
bool enableDefaultUsr = (isIm || m_hContact && !(PopupOptions.actions & ACT_DEF_IMONLY)) ? true : false;
@@ -795,7 +795,7 @@ void AddMessageToDB(MCONTACT hContact, char *msg) DBEVENTINFO dbei = {};
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.flags = DBEF_SENT | DBEF_UTF;
- dbei.szModule = GetContactProto(hContact);
+ dbei.szModule = Proto_GetBaseAccountName(hContact);
dbei.timestamp = time(0);
dbei.cbBlob = (int)mir_strlen(msg) + 1;
dbei.pBlob = (PBYTE)msg;
diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp index cafe1a5093..4692274bcf 100644 --- a/plugins/Popup/src/services.cpp +++ b/plugins/Popup/src/services.cpp @@ -121,7 +121,7 @@ INT_PTR Popup_AddPopup2(WPARAM wParam, LPARAM lParam) // Check if contact handle is valid.
char *proto = nullptr;
if (ppd->lchContact)
- proto = GetContactProto(ppd->lchContact);
+ proto = Proto_GetBaseAccountName(ppd->lchContact);
BYTE bShowMode = proto ? db_get_b(ppd->lchContact, MODULENAME, "ShowMode", PU_SHOWMODE_AUTO) : PU_SHOWMODE_AUTO;
@@ -143,7 +143,7 @@ INT_PTR Popup_AddPopup2(WPARAM wParam, LPARAM lParam) if (proto) {
char prefix[128];
- mir_snprintf(prefix, LPGEN("Protocol Status") "/%s", GetContactProto(ppd->lchContact));
+ mir_snprintf(prefix, LPGEN("Protocol Status") "/%s", Proto_GetBaseAccountName(ppd->lchContact));
if (g_plugin.getDword(prefix, 0) & Proto_Status2Flag_My(Proto_GetStatus(proto)))
return -1;
if (((disableWhen >> 16) & 0xFFFF0000) & Proto_Status2Flag_My(Proto_GetStatus(proto)))
diff --git a/plugins/QuickContacts/src/dialog.cpp b/plugins/QuickContacts/src/dialog.cpp index 36e198c813..9e8bdf112d 100644 --- a/plugins/QuickContacts/src/dialog.cpp +++ b/plugins/QuickContacts/src/dialog.cpp @@ -110,7 +110,7 @@ void SortArray(void) int GetStatus(MCONTACT hContact, char *proto = nullptr) { if (proto == nullptr) - proto = GetContactProto(hContact); + proto = Proto_GetBaseAccountName(hContact); if (proto == nullptr) return ID_STATUS_OFFLINE; @@ -140,7 +140,7 @@ void LoadContacts(HWND hwndDlg, BOOL show_all) FreeContacts(); for (auto &hContact : Contacts()) { - char *pszProto = GetContactProto(hContact); + char *pszProto = Proto_GetBaseAccountName(hContact); if (pszProto == nullptr) continue; @@ -236,7 +236,7 @@ void EnableButtons(HWND hwndDlg, MCONTACT hContact) // Get caps INT_PTR caps = 0; - char *pszProto = GetContactProto(hContact); + char *pszProto = Proto_GetBaseAccountName(hContact); if (pszProto != nullptr) caps = CallProtoService(pszProto, PS_GETCAPS, PFLAGNUM_1, 0); diff --git a/plugins/QuickMessages/src/Utils.cpp b/plugins/QuickMessages/src/Utils.cpp index 40c17c2111..0305c08ebf 100644 --- a/plugins/QuickMessages/src/Utils.cpp +++ b/plugins/QuickMessages/src/Utils.cpp @@ -446,7 +446,7 @@ wchar_t* ParseString(MCONTACT hContact, wchar_t* ptszQValIn, wchar_t* ptszText, i = -1; break; case 'P': - ptszName = mir_a2u(GetContactProto(hContact)); + ptszName = mir_a2u(Proto_GetBaseAccountName(hContact)); NameLenght = (int)mir_wstrlen(ptszName); p = (wchar_t *)realloc(tempQValue, (QVSize + NameLenght + 1) * sizeof(wchar_t)); if (!p) { diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp index 2cdd83d937..9f31886c71 100644 --- a/plugins/RecentContacts/src/RecentContacts.cpp +++ b/plugins/RecentContacts/src/RecentContacts.cpp @@ -216,7 +216,7 @@ INT_PTR CALLBACK ShowListMainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM continue;
if (LastUCOpt.HideOffline == 1) {
- szProto = GetContactProto(curContact->second);
+ szProto = Proto_GetBaseAccountName(curContact->second);
if (szProto != nullptr && db_get_w(curContact->second, szProto, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE)
continue;
}
diff --git a/plugins/RemovePersonalSettings/src/rps.cpp b/plugins/RemovePersonalSettings/src/rps.cpp index 8c1f75dd5a..04dca97f54 100644 --- a/plugins/RemovePersonalSettings/src/rps.cpp +++ b/plugins/RemovePersonalSettings/src/rps.cpp @@ -260,7 +260,7 @@ void DeleteSetting(const char *setting) BOOL isMetaContact(MCONTACT hContact)
{
- return mir_strcmp(GetContactProto(hContact), METACONTACTS_PROTOCOL_NAME) == 0;
+ return mir_strcmp(Proto_GetBaseAccountName(hContact), METACONTACTS_PROTOCOL_NAME) == 0;
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp index 34b64b6081..025cca09b6 100644 --- a/plugins/Scriver/src/globals.cpp +++ b/plugins/Scriver/src/globals.cpp @@ -145,7 +145,7 @@ static int ackevent(WPARAM, LPARAM lParam) DBEVENTINFO dbei = {};
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.flags = DBEF_UTF | DBEF_SENT | ((item->flags & PREF_RTL) ? DBEF_RTL : 0);
- dbei.szModule = GetContactProto(hContact);
+ dbei.szModule = Proto_GetBaseAccountName(hContact);
dbei.timestamp = time(0);
dbei.cbBlob = (int)mir_strlen(item->sendBuffer) + 1;
dbei.pBlob = (PBYTE)item->sendBuffer;
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 7fad1b8f79..365190bfc8 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -197,7 +197,7 @@ void CMsgDialog::Init() g_arDialogs.insert(this);
m_autoClose = CLOSE_ON_CANCEL;
- m_szProto = GetContactProto(m_hContact);
+ m_szProto = Proto_GetBaseAccountName(m_hContact);
SetParent(GetParentWindow(m_hContact, isChat()));
m_pParent = (ParentWindowData *)GetWindowLongPtr(m_hwndParent, GWLP_USERDATA);
diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index d01d2a9bab..1a088be1b7 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -804,7 +804,7 @@ void CLogWindow::LogEvents(MEVENT hDbEventFirst, int count, bool bAppend) smre.hwndRichEditControl = m_rtf.GetHwnd();
MCONTACT hContact = db_mc_getSrmmSub(m_pDlg.m_hContact);
- smre.Protocolname = (hContact != 0) ? GetContactProto(hContact) : m_pDlg.m_szProto;
+ smre.Protocolname = (hContact != 0) ? Proto_GetBaseAccountName(hContact) : m_pDlg.m_szProto;
if (fi.chrg.cpMin > 0) {
sel.cpMin = fi.chrg.cpMin;
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index a2175f52e5..b943a7a5f1 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -54,11 +54,11 @@ static int SRMMStatusToPf2(int status) int IsAutoPopup(MCONTACT hContact) {
if (g_dat.flags.bAutoPopup) {
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
hContact = db_mc_getSrmmSub(hContact);
if (hContact != 0)
- szProto = GetContactProto(hContact);
+ szProto = Proto_GetBaseAccountName(hContact);
if (szProto && (g_dat.openFlags & SRMMStatusToPf2(Proto_GetStatus(szProto))))
return 1;
@@ -132,7 +132,7 @@ static INT_PTR SendMessageCommandWorker(MCONTACT hContact, wchar_t *pszMsg) hContact = db_mc_tryMeta(hContact);
/* does the MCONTACT's protocol support IM messages? */
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto == nullptr)
return 1; /* unknown contact */
@@ -213,7 +213,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam) static int MessageSettingChanged(WPARAM hContact, LPARAM lParam)
{
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *)lParam;
- char *szProto = GetContactProto(hContact); // szProto maybe nullptr
+ char *szProto = Proto_GetBaseAccountName(hContact); // szProto maybe nullptr
if (!strcmp(cws->szModule, "CList") || !mir_strcmp(cws->szModule, szProto))
Srmm_Broadcast(DM_CLISTSETTINGSCHANGED, hContact, lParam);
return 0;
@@ -296,7 +296,7 @@ static int PrebuildContactMenu(WPARAM hContact, LPARAM) return 0;
bool bEnabled = false;
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if ( szProto ) {
// leave this menu item hidden for chats
if ( !db_get_b(hContact, szProto, "ChatRoom", 0))
diff --git a/plugins/Scriver/src/msgutils.cpp b/plugins/Scriver/src/msgutils.cpp index 47dc5e8de8..7196f22271 100644 --- a/plugins/Scriver/src/msgutils.cpp +++ b/plugins/Scriver/src/msgutils.cpp @@ -237,7 +237,7 @@ void CMsgDialog::SetStatusIcon() if (hContact == 0) hContact = m_hContact; - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); m_hStatusIcon = Skin_LoadProtoIcon(szProto, m_wStatus, false); m_hStatusIconBig = Skin_LoadProtoIcon(szProto, m_wStatus, true); diff --git a/plugins/SecureIM/src/commonheaders.h b/plugins/SecureIM/src/commonheaders.h index 794d5dd4db..2f710f4acd 100644 --- a/plugins/SecureIM/src/commonheaders.h +++ b/plugins/SecureIM/src/commonheaders.h @@ -94,7 +94,7 @@ extern mir_cs localQueueMutex; __forceinline int SendBroadcast(MCONTACT hContact, int type, int result, HANDLE hProcess, LPARAM lParam)
{
- return ProtoBroadcastAck( GetContactProto(hContact), hContact, type, result, hProcess, lParam);
+ return ProtoBroadcastAck( Proto_GetBaseAccountName(hContact), hContact, type, result, hProcess, lParam);
}
extern HNETLIBUSER hNetlibUser;
diff --git a/plugins/SecureIM/src/dbevent.cpp b/plugins/SecureIM/src/dbevent.cpp index a072dd108c..a809314640 100644 --- a/plugins/SecureIM/src/dbevent.cpp +++ b/plugins/SecureIM/src/dbevent.cpp @@ -3,7 +3,7 @@ void HistoryLog(MCONTACT hContact, LPCSTR szText)
{
DBEVENTINFO dbei = {};
- dbei.szModule = GetContactProto(hContact);
+ dbei.szModule = Proto_GetBaseAccountName(hContact);
dbei.flags = DBEF_SENT | DBEF_READ;
dbei.timestamp = time(0);
dbei.eventType = EVENTTYPE_MESSAGE;
diff --git a/plugins/SeenPlugin/src/menu.cpp b/plugins/SeenPlugin/src/menu.cpp index 15651965fb..fc62ca1d0f 100644 --- a/plugins/SeenPlugin/src/menu.cpp +++ b/plugins/SeenPlugin/src/menu.cpp @@ -36,7 +36,7 @@ INT_PTR MenuitemClicked(WPARAM hContact, LPARAM) int BuildContactMenu(WPARAM hContact, LPARAM)
{
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (!IsWatchedProtocol(szProto) || db_get_b(hContact, szProto, "ChatRoom", false) || !g_plugin.getByte("MenuItem", 1)) {
Menu_ShowItem(hmenuitem, false);
return 0;
diff --git a/plugins/SeenPlugin/src/userinfo.cpp b/plugins/SeenPlugin/src/userinfo.cpp index e5991e8e86..2f2966d25a 100644 --- a/plugins/SeenPlugin/src/userinfo.cpp +++ b/plugins/SeenPlugin/src/userinfo.cpp @@ -65,7 +65,7 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar int UserinfoInit(WPARAM wparam, LPARAM hContact)
{
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (IsWatchedProtocol(szProto) && !db_get_b(hContact, szProto, "ChatRoom", false)) {
OPTIONSDIALOGPAGE uip = { sizeof(uip) };
uip.pszTemplate = MAKEINTRESOURCEA(IDD_USERINFO);
diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index bf7c68f8e5..605e82fe8d 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -161,7 +161,7 @@ CMStringW ParseString(const wchar_t *pwszFormat, MCONTACT hcontact) if (!isSeen(hcontact, &st))
return TranslateT("<never seen>");
- char *szProto = hcontact ? GetContactProto(hcontact) : courProtoName;
+ char *szProto = hcontact ? Proto_GetBaseAccountName(hcontact) : courProtoName;
ptrW info;
CMStringW res;
@@ -518,7 +518,7 @@ int UpdateValues(WPARAM hContact, LPARAM lparam) return 0;
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *)lparam;
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (cws->value.type == DBVT_DWORD && !strcmp(cws->szSetting, "LastSeen") && !mir_strcmp(cws->szModule, szProto)) {
DBWriteTimeTS(cws->value.dVal, hContact);
@@ -563,7 +563,7 @@ int UpdateValues(WPARAM hContact, LPARAM lparam) if (g_bFileActive)
FileWrite(hContact);
- char *sProto = GetContactProto(hContact);
+ char *sProto = Proto_GetBaseAccountName(hContact);
if (Proto_GetStatus(sProto) > ID_STATUS_OFFLINE) {
myPlaySound(hContact, ID_STATUS_OFFLINE, prevStatus);
if (g_plugin.getByte("UsePopups", 0))
@@ -588,7 +588,7 @@ int UpdateValues(WPARAM hContact, LPARAM lparam) if (prevStatus != cws->value.wVal) myPlaySound(hContact, cws->value.wVal, prevStatus);
if (g_plugin.getByte("UsePopups", 0))
if (prevStatus != cws->value.wVal)
- ShowPopup(hContact, GetContactProto(hContact), cws->value.wVal | 0x8000);
+ ShowPopup(hContact, Proto_GetBaseAccountName(hContact), cws->value.wVal | 0x8000);
if (g_plugin.getByte("KeepHistory", 0))
HistoryWrite(hContact);
diff --git a/plugins/SendScreenshotPlus/src/CSend.cpp b/plugins/SendScreenshotPlus/src/CSend.cpp index 9252ba7649..051cda0c9b 100644 --- a/plugins/SendScreenshotPlus/src/CSend.cpp +++ b/plugins/SendScreenshotPlus/src/CSend.cpp @@ -65,7 +65,7 @@ void CSend::SetContact(MCONTACT hContact) { m_hContact = hContact; if (hContact) { - m_pszProto = GetContactProto(hContact); + m_pszProto = Proto_GetBaseAccountName(hContact); m_ChatRoom = db_get_b(hContact, m_pszProto, "ChatRoom", 0); } } diff --git a/plugins/SendScreenshotPlus/src/Main.cpp b/plugins/SendScreenshotPlus/src/Main.cpp index 72552888dd..4676b7e61e 100644 --- a/plugins/SendScreenshotPlus/src/Main.cpp +++ b/plugins/SendScreenshotPlus/src/Main.cpp @@ -139,7 +139,7 @@ INT_PTR service_SendDesktop(WPARAM wParam, LPARAM) return -1; } MCONTACT hContact = (MCONTACT)wParam; - char *pszProto = GetContactProto(hContact); + char *pszProto = Proto_GetBaseAccountName(hContact); bool bChatRoom = db_get_b(hContact, pszProto, "ChatRoom", 0) != 0; frmMain->m_opt_chkTimed = false; frmMain->m_opt_tabCapture = 1; @@ -237,7 +237,7 @@ int hook_SystemPreShutdown(WPARAM, LPARAM) int hook_PrebuildContactMenu(WPARAM hContact, LPARAM) { - INT_PTR flags = CallProtoService(GetContactProto(hContact), PS_GETCAPS, PFLAGNUM_1, 0); + INT_PTR flags = CallProtoService(Proto_GetBaseAccountName(hContact), PS_GETCAPS, PFLAGNUM_1, 0); bool bEnabled = (flags != CALLSERVICE_NOTFOUND) && (flags & PF1_FILE) != 0; Menu_ShowItem(g_hMenu1, bEnabled); Menu_ShowItem(g_hMenu2, bEnabled); diff --git a/plugins/ShellExt/src/shlcom.cpp b/plugins/ShellExt/src/shlcom.cpp index 82b593cac7..12d8cf5234 100644 --- a/plugins/ShellExt/src/shlcom.cpp +++ b/plugins/ShellExt/src/shlcom.cpp @@ -256,7 +256,7 @@ bool ipcGetSortedContacts(THeaderIPC * ipch, int* pSlot, bool bGroupMode) break;
// do they have a running protocol?
- char* szProto = GetContactProto(hContact);
+ char* szProto = Proto_GetBaseAccountName(hContact);
if (szProto != nullptr) {
// does it support file sends?
DWORD dwCaps = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0);
diff --git a/plugins/SimpleAR/src/Main.cpp b/plugins/SimpleAR/src/Main.cpp index 2ae24b208e..6e892f2314 100644 --- a/plugins/SimpleAR/src/Main.cpp +++ b/plugins/SimpleAR/src/Main.cpp @@ -133,7 +133,7 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) if (!fEnabled || !hContact || !hDBEvent)
return FALSE; /// unspecified error
- char *pszProto = GetContactProto(hContact);
+ char *pszProto = Proto_GetBaseAccountName(hContact);
int status = Proto_GetStatus(pszProto);
if (status == ID_STATUS_ONLINE || status == ID_STATUS_FREECHAT || status == ID_STATUS_INVISIBLE)
return FALSE;
diff --git a/plugins/SimpleStatusMsg/src/awaymsg.cpp b/plugins/SimpleStatusMsg/src/awaymsg.cpp index 0e0b646b29..f8f778bff6 100644 --- a/plugins/SimpleStatusMsg/src/awaymsg.cpp +++ b/plugins/SimpleStatusMsg/src/awaymsg.cpp @@ -56,7 +56,7 @@ public: wchar_t str[256], format[128];
wchar_t *contactName = Clist_GetContactDisplayName(m_hContact, 0);
- char *szProto = GetContactProto(m_hContact);
+ char *szProto = Proto_GetBaseAccountName(m_hContact);
WORD dwStatus = db_get_w(m_hContact, szProto, "Status", ID_STATUS_OFFLINE);
wchar_t *status = Clist_GetStatusModeDescription(dwStatus, 0);
@@ -293,7 +293,7 @@ static int AwayMsgPreBuildMenu(WPARAM hContact, LPARAM) Menu_ShowItem(hGoToURLMenuItem, false);
Menu_ShowItem(hAwayMsgMenuItem, false);
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto == nullptr || db_get_b(hContact, szProto, "ChatRoom", 0))
return 0;
diff --git a/plugins/SmileyAdd/src/dlgboxsubclass.cpp b/plugins/SmileyAdd/src/dlgboxsubclass.cpp index 1a786ddae2..078d6e46be 100644 --- a/plugins/SmileyAdd/src/dlgboxsubclass.cpp +++ b/plugins/SmileyAdd/src/dlgboxsubclass.cpp @@ -163,7 +163,7 @@ static int MsgDlgHook(WPARAM, LPARAM lParam) msgwnd->hwndInput = wndEvtData->hwndInput;
// Get the protocol for this contact to display correct smileys.
- char *protonam = GetContactProto(DecodeMetaContact(msgwnd->hContact));
+ char *protonam = Proto_GetBaseAccountName(DecodeMetaContact(msgwnd->hContact));
if (protonam)
strncpy_s(msgwnd->ProtocolName, protonam, _TRUNCATE);
diff --git a/plugins/SmileyAdd/src/services.cpp b/plugins/SmileyAdd/src/services.cpp index 65cea6dce4..7cfe8d1f97 100644 --- a/plugins/SmileyAdd/src/services.cpp +++ b/plugins/SmileyAdd/src/services.cpp @@ -43,7 +43,7 @@ SmileyPackType* GetSmileyPack(const char *proto, MCONTACT hContact, SmileyPackCT }
if (categoryName.IsEmpty() && !opt.UseOneForAll) {
- char *protonam = GetContactProto(hContact);
+ char *protonam = Proto_GetBaseAccountName(hContact);
if (protonam != nullptr) {
DBVARIANT dbv;
if (db_get_ws(hContact, protonam, "Transport", &dbv) == 0) {
@@ -268,7 +268,7 @@ int RebuildContactMenu(WPARAM wParam, LPARAM) {
SmileyCategoryListType::SmileyCategoryVectorType &smc = *g_SmileyCategories.GetSmileyCategoryList();
- char *protnam = GetContactProto(wParam);
+ char *protnam = Proto_GetBaseAccountName(wParam);
bool haveMenu = IsSmileyProto(protnam);
if (haveMenu && opt.UseOneForAll) {
unsigned cnt = 0;
diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp index 4a8a033588..734d66acd2 100644 --- a/plugins/SmileyAdd/src/smileys.cpp +++ b/plugins/SmileyAdd/src/smileys.cpp @@ -231,7 +231,7 @@ void SmileyType::CallSmileyService(MCONTACT hContact) const char *proto = ""; if (name[0] == '/') { - proto = (const char*)GetContactProto(hContact); + proto = (const char*)Proto_GetBaseAccountName(hContact); if (proto == nullptr) return; } @@ -865,7 +865,7 @@ void SmileyCategoryListType::DeleteAccountAsCategory(PROTOACCOUNT *acc) CMStringW tname(_A2T(acc->szModuleName)); for (auto &hContact : Contacts()) { - char *proto = GetContactProto(hContact); + char *proto = Proto_GetBaseAccountName(hContact); if (proto == nullptr) continue; @@ -888,7 +888,7 @@ void SmileyCategoryListType::DeleteAccountAsCategory(PROTOACCOUNT *acc) void SmileyCategoryListType::AddContactTransportAsCategory(MCONTACT hContact, const CMStringW &defaultFile) { - char *proto = GetContactProto(hContact); + char *proto = Proto_GetBaseAccountName(hContact); if (proto == nullptr) return; diff --git a/plugins/SpellChecker/src/utils.cpp b/plugins/SpellChecker/src/utils.cpp index 017dcb09c2..82e7d73de3 100644 --- a/plugins/SpellChecker/src/utils.cpp +++ b/plugins/SpellChecker/src/utils.cpp @@ -721,7 +721,7 @@ void GetUserProtoLanguageSetting(Dialog *dlg, MCONTACT hContact, char *group, ch void GetUserLanguageSetting(Dialog *dlg, char *setting)
{
- char *proto = GetContactProto(dlg->hContact);
+ char *proto = Proto_GetBaseAccountName(dlg->hContact);
if (proto == nullptr)
return;
diff --git a/plugins/StartupSilence/src/main.cpp b/plugins/StartupSilence/src/main.cpp index 5a2241f494..cb614e60de 100644 --- a/plugins/StartupSilence/src/main.cpp +++ b/plugins/StartupSilence/src/main.cpp @@ -129,7 +129,7 @@ int DisablePopup(WPARAM wParam, LPARAM) {
MCONTACT hContact = wParam;
if (hContact != NULL) {
- char* cp = GetContactProto(hContact);
+ char* cp = Proto_GetBaseAccountName(hContact);
if (!mir_strcmp(cp, "Weather") || !mir_strcmp(cp, "mRadio"))
return 0;
return 1;
diff --git a/plugins/StopSpamMod/src/utilities.cpp b/plugins/StopSpamMod/src/utilities.cpp index d8dd94c673..6e1ee82c2d 100755 --- a/plugins/StopSpamMod/src/utilities.cpp +++ b/plugins/StopSpamMod/src/utilities.cpp @@ -331,9 +331,9 @@ void HistoryLogFunc(MCONTACT hContact, std::string message) std::string msg = message;
msg.append("\n");
- msg.append("Protocol: ").append(GetContactProto(hContact)).append(" Contact: ");
+ msg.append("Protocol: ").append(Proto_GetBaseAccountName(hContact)).append(" Contact: ");
msg.append(toUTF8(Clist_GetContactDisplayName(hContact))).append(" ID: ");
- msg.append(toUTF8(GetContactUid(hContact, toUTF16(GetContactProto(hContact)))));
+ msg.append(toUTF8(GetContactUid(hContact, toUTF16(Proto_GetBaseAccountName(hContact)))));
HistoryLog(NULL, (char*)msg.c_str(), EVENTTYPE_MESSAGE, DBEF_READ);
}
}
diff --git a/plugins/StopSpamPlus/src/services.cpp b/plugins/StopSpamPlus/src/services.cpp index de73b2b6e8..8aa5200f25 100644 --- a/plugins/StopSpamPlus/src/services.cpp +++ b/plugins/StopSpamPlus/src/services.cpp @@ -2,7 +2,7 @@ INT_PTR IsContactPassed(WPARAM hContact, LPARAM /*lParam*/)
{
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto == nullptr)
return CS_PASSED;
@@ -28,7 +28,7 @@ INT_PTR RemoveTempContacts(WPARAM, LPARAM lParam) ptrW szGroup(Clist_GetGroup(hContact));
if (!Contact_OnList(hContact) || (szGroup != NULL && (wcsstr(szGroup, L"Not In List") || wcsstr(szGroup, TranslateT("Not In List"))))) {
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto != nullptr) {
// Check if protocol uses server side lists
DWORD caps = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0);
diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp index b090a201b6..53eeea1481 100644 --- a/plugins/TabSRMM/src/contactcache.cpp +++ b/plugins/TabSRMM/src/contactcache.cpp @@ -129,7 +129,7 @@ void CContactCache::updateMeta() if (m_isValid) { MCONTACT hOldSub = m_hSub; m_hSub = db_mc_getSrmmSub(cc->contactID); - m_szMetaProto = GetContactProto(m_hSub); + m_szMetaProto = Proto_GetBaseAccountName(m_hSub); m_iMetaStatus = (WORD)db_get_w(m_hSub, m_szMetaProto, "Status", ID_STATUS_OFFLINE); PROTOACCOUNT *pa = Proto_GetAccount(m_szMetaProto); if (pa) diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index 989946c157..02223db5c0 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -1348,7 +1348,7 @@ panel_found: break;
case ID_TABMENU_LEAVECHATROOM:
if (dat && dat->isChat() && dat->m_hContact) {
- char *szProto = GetContactProto(dat->m_hContact);
+ char *szProto = Proto_GetBaseAccountName(dat->m_hContact);
if (szProto)
CallProtoService(szProto, PS_LEAVECHAT, dat->m_hContact, 0);
}
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 724b062375..81ed720086 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -633,7 +633,7 @@ void CMsgDialog::DM_SetDBButtonStates() continue; } if (buttonItem->dwFlags & BUTTON_ISCONTACTDBACTION) - szModule = GetContactProto(m_hContact); + szModule = Proto_GetBaseAccountName(m_hContact); hFinalContact = m_hContact; } else hFinalContact = 0; diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp index dab38a84a2..ca5759c1e8 100644 --- a/plugins/TabSRMM/src/hotkeyhandler.cpp +++ b/plugins/TabSRMM/src/hotkeyhandler.cpp @@ -362,7 +362,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP else
SendMessage(hWnd, WM_CLOSE, 0, 1);
- char *szProto = GetContactProto(lParam);
+ char *szProto = Proto_GetBaseAccountName(lParam);
if (szProto != nullptr && db_get_b(lParam, szProto, "ChatRoom", 0))
ShowRoom((TContainerData*)wParam, SM_FindSessionByHCONTACT(lParam));
else
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp index 63a577702d..984d8bd1c0 100644 --- a/plugins/TabSRMM/src/mim.cpp +++ b/plugins/TabSRMM/src/mim.cpp @@ -349,7 +349,7 @@ int CMimAPI::PrebuildContactMenu(WPARAM hContact, LPARAM) return 0; bool bEnabled = false; - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); if (szProto) { // leave this menu item hidden for chats if (!db_get_b(hContact, szProto, "ChatRoom", 0)) @@ -472,9 +472,9 @@ int CMimAPI::MessageEventAdded(WPARAM hContact, LPARAM hDbEvent) if (dwStatusMask == -1) bAllowAutoCreate = true; else { - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); if (szProto && !mir_strcmp(szProto, META_PROTO)) - szProto = GetContactProto(db_mc_getSrmmSub(hContact)); + szProto = Proto_GetBaseAccountName(db_mc_getSrmmSub(hContact)); if (szProto) { int dwStatus = Proto_GetStatus(szProto); diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index bca0840c84..5111009456 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -360,7 +360,7 @@ CMsgDialog::CMsgDialog(SESSION_INFO *si) : void CMsgDialog::Init()
{
- m_szProto = GetContactProto(m_hContact);
+ m_szProto = Proto_GetBaseAccountName(m_hContact);
m_autoClose = CLOSE_ON_CANCEL;
m_forceResizable = true;
m_bFilterEnabled = db_get_b(m_hContact, CHAT_MODULE, "FilterEnabled", m_bFilterEnabled) != 0;
diff --git a/plugins/TabSRMM/src/msgdlgother.cpp b/plugins/TabSRMM/src/msgdlgother.cpp index 72fcc8ca6a..d4ca925009 100644 --- a/plugins/TabSRMM/src/msgdlgother.cpp +++ b/plugins/TabSRMM/src/msgdlgother.cpp @@ -1095,7 +1095,7 @@ int CMsgDialog::MsgWindowMenuHandler(int selection, int menuId) break; case ID_TABMENU_LEAVECHATROOM: if (isChat() && m_hContact != 0) { - char *szProto = GetContactProto(m_hContact); + char *szProto = Proto_GetBaseAccountName(m_hContact); if (szProto) CallProtoService(szProto, PS_LEAVECHAT, m_hContact, 0); } diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index ed1c11e543..e60ae9077a 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -158,7 +158,7 @@ INT_PTR SendMessageCommand_Worker(MCONTACT hContact, LPCSTR pszMsg, bool isWchar }
// does the MCONTACT's protocol support IM messages?
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto == nullptr)
return 0; // unknown contact
if (0 == (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND))
@@ -325,7 +325,7 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact, if ((pContainer = CreateContainer(L"default", CNT_CREATEFLAG_CLONED, hContact)) == nullptr)
return nullptr;
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
// obtain various status information about the contact
wchar_t *contactName = Clist_GetContactDisplayName(hContact);
diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp index 456f10b32e..aecb09cb96 100644 --- a/plugins/TabSRMM/src/sendlater.cpp +++ b/plugins/TabSRMM/src/sendlater.cpp @@ -438,7 +438,7 @@ HANDLE CSendLater::processAck(const ACKDATA *ack) DBEVENTINFO dbei = {};
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.flags = DBEF_SENT | DBEF_UTF;
- dbei.szModule = GetContactProto((p->hContact));
+ dbei.szModule = Proto_GetBaseAccountName((p->hContact));
dbei.timestamp = time(0);
dbei.cbBlob = (int)mir_strlen(p->sendBuffer) + 1;
dbei.pBlob = (PBYTE)(p->sendBuffer);
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index e669e0dd54..0af8e31652 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -461,7 +461,7 @@ int SendQueue::ackMessage(CMsgDialog *dat, WPARAM wParam, LPARAM lParam) DBEVENTINFO dbei = {}; dbei.eventType = EVENTTYPE_MESSAGE; dbei.flags = DBEF_SENT | DBEF_UTF; - dbei.szModule = GetContactProto(job.hContact); + dbei.szModule = Proto_GetBaseAccountName(job.hContact); dbei.timestamp = time(0); dbei.cbBlob = (int)mir_strlen(job.szSendBuffer) + 1; @@ -553,7 +553,7 @@ int SendQueue::doSendLater(int iJobIndex, CMsgDialog *dat, MCONTACT hContact, bo DBEVENTINFO dbei = {}; dbei.eventType = EVENTTYPE_MESSAGE; dbei.flags = DBEF_SENT | DBEF_UTF; - dbei.szModule = GetContactProto(dat->m_hContact); + dbei.szModule = Proto_GetBaseAccountName(dat->m_hContact); dbei.timestamp = time(0); dbei.cbBlob = (int)mir_strlen(utfText) + 1; dbei.pBlob = (PBYTE)(char*)utfText; diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp index b168691a1d..cf511c431d 100644 --- a/plugins/TabSRMM/src/templates.cpp +++ b/plugins/TabSRMM/src/templates.cpp @@ -148,10 +148,10 @@ bool CTemplateEditDlg::OnInitDialog() // set hContact to the first found contact so that we can use the Preview window properly // also, set other parameters needed by the streaming function to display events m_hContact = db_find_first(); - m_szProto = GetContactProto(m_hContact); + m_szProto = Proto_GetBaseAccountName(m_hContact); while (m_szProto == nullptr && m_hContact != 0) { m_hContact = db_find_next(m_hContact); - m_szProto = GetContactProto(m_hContact); + m_szProto = Proto_GetBaseAccountName(m_hContact); } m_dwFlags = m_pContainer->m_theme.dwFlags; diff --git a/plugins/TabSRMM/src/trayicon.cpp b/plugins/TabSRMM/src/trayicon.cpp index 2e1f498fa5..d7d53ff89f 100644 --- a/plugins/TabSRMM/src/trayicon.cpp +++ b/plugins/TabSRMM/src/trayicon.cpp @@ -196,7 +196,7 @@ void TSAPI AddContactToFavorites(MCONTACT hContact, const wchar_t *szNickname, c wcsncpy_s(szFinalNick, szNickname, _TRUNCATE);
if (szProto == nullptr)
- szProto = GetContactProto(hContact);
+ szProto = Proto_GetBaseAccountName(hContact);
if (szProto == nullptr)
return;
diff --git a/plugins/TipperYM/src/message_pump.cpp b/plugins/TipperYM/src/message_pump.cpp index 220b974f7f..fd851af172 100644 --- a/plugins/TipperYM/src/message_pump.cpp +++ b/plugins/TipperYM/src/message_pump.cpp @@ -50,7 +50,7 @@ bool NeedWaitForContent(CLCINFOTIPEX *clcitex) bool bNeedWait = false;
if (opt.bWaitForContent && IsContactTooltip(clcitex)) {
MCONTACT hContact = (DWORD_PTR)clcitex->hItem;
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (!szProto) return false;
if (opt.bWaitForStatusMsg && !bStatusMsgReady) {
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp index b322ea68d4..4b08036ac0 100644 --- a/plugins/TipperYM/src/popwin.cpp +++ b/plugins/TipperYM/src/popwin.cpp @@ -306,7 +306,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa wcsncpy_s(pwd->swzTitle, Clist_GetContactDisplayName(pwd->hContact), _TRUNCATE); - char *szProto = GetContactProto(pwd->hContact); + char *szProto = Proto_GetBaseAccountName(pwd->hContact); pwd->spiTitle = Smileys_PreParse(pwd->swzTitle, -1, szProto); // get extra icons @@ -1035,7 +1035,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa } else pwd->rows = (RowData *)mir_realloc(pwd->rows, sizeof(RowData)* (pwd->iRowCount + 1)); - char *szProto = GetContactProto(pwd->hContact); + char *szProto = Proto_GetBaseAccountName(pwd->hContact); pwd->rows[pwd->iRowCount].swzLabel = mir_wstrdup(buff_label); pwd->rows[pwd->iRowCount].swzValue = mir_wstrdup(buff); @@ -1580,7 +1580,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa for (auto &hContact : Contacts()) { if (g_plugin.getByte(hContact, "FavouriteContact")) { - char *proto = GetContactProto(hContact); + char *proto = Proto_GetBaseAccountName(hContact); if (proto == nullptr) continue; diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp index 78ae3c6c55..790d2b9a32 100644 --- a/plugins/TipperYM/src/subst.cpp +++ b/plugins/TipperYM/src/subst.cpp @@ -65,7 +65,7 @@ bool CheckContactType(MCONTACT hContact, const DISPLAYITEM &di) if (di.type == DIT_ALL) return true; - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); if (szProto) { if (db_get_b(hContact, szProto, "ChatRoom", 0) != 0) return di.type == DIT_CHATS; @@ -140,7 +140,7 @@ void FormatTimestamp(DWORD ts, char *szFormat, wchar_t *buff, int bufflen) bool Uid(MCONTACT hContact, char *szProto, wchar_t *buff, int bufflen) { - char *tmpProto = (hContact ? GetContactProto(hContact) : szProto); + char *tmpProto = (hContact ? Proto_GetBaseAccountName(hContact) : szProto); if (tmpProto) { const char *szUid = Proto_GetUniqueId(tmpProto); if (szUid) @@ -211,7 +211,7 @@ wchar_t* GetStatusMessageText(MCONTACT hContact) wchar_t *swzMsg = nullptr; DBVARIANT dbv; - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); if (szProto) { if (!mir_strcmp(szProto, META_PROTO)) hContact = db_mc_getMostOnline(hContact); @@ -254,7 +254,7 @@ bool GetSysSubstText(MCONTACT hContact, wchar_t *swzRawSpec, wchar_t *buff, int return Uid(hContact, nullptr, buff, bufflen); if (!mir_wstrcmp(swzRawSpec, L"proto")) { - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); if (szProto) { a2t(szProto, buff, bufflen); return true; @@ -280,7 +280,7 @@ bool GetSysSubstText(MCONTACT hContact, wchar_t *swzRawSpec, wchar_t *buff, int return true; } else if (!mir_wstrcmp(swzRawSpec, L"uidname")) { - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); return UidName(szProto, buff, bufflen); } else if (!mir_wstrcmp(swzRawSpec, L"status_msg")) { @@ -356,7 +356,7 @@ bool GetSysSubstText(MCONTACT hContact, wchar_t *swzRawSpec, wchar_t *buff, int int iNumber = 1; MCONTACT hTmpContact = hContact; - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); if (szProto && !mir_strcmp(szProto, META_PROTO)) { iNumber = db_mc_getSubCount(hContact); hTmpContact = db_mc_getSub(hContact, 0); @@ -434,7 +434,7 @@ bool GetSubstText(MCONTACT hContact, const DISPLAYSUBST &ds, wchar_t *buff, int case DVT_DB: return transFunc(hContact, ds.szModuleName, ds.szSettingName, buff, bufflen) != nullptr; case DVT_PROTODB: - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); if (szProto) { if (transFunc(hContact, szProto, ds.szSettingName, buff, bufflen) != nullptr) return true; @@ -452,7 +452,7 @@ bool GetRawSubstText(MCONTACT hContact, char *szRawSpec, wchar_t *buff, int buff if (szRawSpec[i] == '/') { szRawSpec[i] = 0; if (mir_strlen(szRawSpec) == 0) { - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); if (szProto) { if (translations[0].transFunc(hContact, szProto, &szRawSpec[i + 1], buff, bufflen) != nullptr) return true; @@ -507,7 +507,7 @@ bool ApplySubst(MCONTACT hContact, const wchar_t *swzSource, bool parseTipperVar *p = 0; p++; if (*p) { - char *cp = GetContactProto(hContact); + char *cp = Proto_GetBaseAccountName(hContact); if (cp != nullptr) { PROTOACCOUNT *acc = Proto_GetAccount(cp); if (acc != nullptr) { @@ -748,11 +748,11 @@ wchar_t* GetProtoExtraStatusMessage(char *szProto) if (ServiceExists(MS_VARS_FORMATSTRING)) { MCONTACT hContact = db_find_first(); - char *proto = GetContactProto(hContact); + char *proto = Proto_GetBaseAccountName(hContact); while (!proto) { hContact = db_find_next(hContact); if (hContact) - proto = GetContactProto(hContact); + proto = Proto_GetBaseAccountName(hContact); else { hContact = NULL; break; diff --git a/plugins/Toaster/src/services.cpp b/plugins/Toaster/src/services.cpp index fe5bd912fd..ed318ac5fb 100644 --- a/plugins/Toaster/src/services.cpp +++ b/plugins/Toaster/src/services.cpp @@ -14,7 +14,7 @@ void __stdcall ShowToastNotification(void* p) ptrW imagePath;
if (td->hContact != NULL && td->hContact != INVALID_CONTACT_ID) {
- const char *szProto = GetContactProto(td->hContact);
+ const char *szProto = Proto_GetBaseAccountName(td->hContact);
if (ProtoServiceExists(szProto, PS_GETAVATARINFO)) {
PROTO_AVATAR_INFORMATION pai = { td->hContact };
if (CallProtoService(szProto, PS_GETAVATARINFO, 0, (LPARAM)&pai) == GAIR_SUCCESS)
diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp index 5fe29327b7..6a3855746e 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.cpp +++ b/plugins/TooltipNotify/src/TooltipNotify.cpp @@ -809,7 +809,7 @@ wchar_t* CTooltipNotify::MakeTooltipString(MCONTACT hContact, int iStatus, wchar const wchar_t *szFormatString = m_sOptions.bPrefixProto ? L"%s%s%s" : L"%.0s%.0s%s";
const wchar_t* szIs = TranslateT("is");
- const char* szProto = hContact == 0 ? "Proto" : ::GetContactProto(hContact);
+ const char* szProto = hContact == 0 ? "Proto" : ::Proto_GetBaseAccountName(hContact);
const wchar_t* szContactName = ::Clist_GetContactDisplayName(hContact);
memset(szString, 0, iBufSize*sizeof(wchar_t));
diff --git a/plugins/UserInfoEx/src/Flags/svc_flags.cpp b/plugins/UserInfoEx/src/Flags/svc_flags.cpp index 3f439e7f92..cc162d86ff 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flags.cpp +++ b/plugins/UserInfoEx/src/Flags/svc_flags.cpp @@ -44,7 +44,7 @@ static LIST<MsgWndData> gMsgWndList(10, NumericKeySortT); static INT_PTR ServiceDetectContactOriginCountry(WPARAM wParam,LPARAM)
{
WORD countryNumber;
- char *pszProto = GetContactProto(wParam);
+ char *pszProto = Proto_GetBaseAccountName(wParam);
/* UserinfoEx */
if (countryNumber = db_get_w(wParam, USERINFO, SET_CONTACT_ORIGIN_COUNTRY, 0))
return countryNumber;
diff --git a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp index 0533f11e57..86817fcb89 100644 --- a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp +++ b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp @@ -641,7 +641,7 @@ class CAnnivList * @retval TRUE if successful
* @retval FALSE if failed
**/
- BYTE AddRow(MCONTACT hContact, LPCSTR pszProto, MAnnivDate &ad, MTime &mtNow, WORD wDaysBefore)
+ BYTE AddRow(MCONTACT hContact, LPCSTR pszProto, MAnnivDate &ad, MTime &mtNow, int wDaysBefore)
{
wchar_t szText[MAX_PATH];
int diff, iItem = -1;
@@ -702,54 +702,57 @@ class CAnnivList // This method clears the list and adds contacts again, according to the current filter settings.
void RebuildList()
{
- LPSTR pszProto;
- MTime mtNow;
MAnnivDate ad;
int i = 0;
DWORD age = 0;
- WORD wDaysBefore = g_plugin.getWord(SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET);
- WORD numMale = 0;
- WORD numFemale = 0;
- WORD numContacts = 0;
- WORD numBirthContacts = 0;
+ int wDaysBefore = g_plugin.getWord(SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET);
+ int numMale = 0;
+ int numFemale = 0;
+ int numContacts = 0;
+ int numBirthContacts = 0;
ShowWindow(_hList, SW_HIDE);
DeleteAllItems();
+
+ MTime mtNow;
mtNow.GetLocalTime();
// insert the items into the list
for (auto &hContact : Contacts()) {
- // ignore meta subcontacts here, as they are not interesting.
- if (!db_mc_isSub(hContact)) {
- // filter protocol
- pszProto = Proto_GetBaseAccountName(hContact);
- if (pszProto) {
- numContacts++;
- switch (GenderOf(hContact, pszProto)) {
- case 'M':
- numMale++;
- break;
- case 'F':
- numFemale++;
- }
-
- if (!ad.DBGetBirthDate(hContact, pszProto)) {
- age += ad.Age(&mtNow);
- numBirthContacts++;
+ // ignore metacontacts here, as they are not interesting.
+ if (db_mc_isMeta(hContact))
+ continue;
+
+ // filter protocol
+ char *pszProto = Proto_GetBaseAccountName(hContact);
+ if (!pszProto)
+ continue;
+
+ numContacts++;
+ switch (GenderOf(hContact, pszProto)) {
+ case 'M':
+ numMale++;
+ break;
+ case 'F':
+ numFemale++;
+ }
- // add birthday
- if ((_filter.bFilterIndex != FILTER_ANNIV) && (!_filter.pszProto || !_strcmpi(pszProto, _filter.pszProto)))
- AddRow(hContact, pszProto, ad, mtNow, wDaysBefore);
- }
+ if (!ad.DBGetBirthDate(hContact, pszProto)) {
+ age += ad.Age(&mtNow);
+ numBirthContacts++;
- // add anniversaries
- if (_filter.bFilterIndex != FILTER_BIRTHDAY && (!_filter.pszProto || !_strcmpi(pszProto, _filter.pszProto)))
- for (i = 0; !ad.DBGetAnniversaryDate(hContact, i); i++)
- if (!_filter.pszAnniv || !mir_wstrcmpi(_filter.pszAnniv, ad.Description()))
- AddRow(hContact, pszProto, ad, mtNow, wDaysBefore);
- }
+ // add birthday
+ if ((_filter.bFilterIndex != FILTER_ANNIV) && (!_filter.pszProto || !_strcmpi(pszProto, _filter.pszProto)))
+ AddRow(hContact, pszProto, ad, mtNow, wDaysBefore);
}
+
+ // add anniversaries
+ if (_filter.bFilterIndex != FILTER_BIRTHDAY && (!_filter.pszProto || !_strcmpi(pszProto, _filter.pszProto)))
+ for (i = 0; !ad.DBGetAnniversaryDate(hContact, i); i++)
+ if (!_filter.pszAnniv || !mir_wstrcmpi(_filter.pszAnniv, ad.Description()))
+ AddRow(hContact, pszProto, ad, mtNow, wDaysBefore);
}
+
ListView_SortItemsEx(_hList, (CMPPROC)cmpProc, this);
ShowWindow(_hList, SW_SHOW);
diff --git a/plugins/Utils.pas/mircontacts.pas b/plugins/Utils.pas/mircontacts.pas index 91bb9f34e0..568ab558a0 100644 --- a/plugins/Utils.pas/mircontacts.pas +++ b/plugins/Utils.pas/mircontacts.pas @@ -9,7 +9,6 @@ uses //----- Contact info -----
-function GetContactProto(hContact: TMCONTACT): PAnsiChar; overload;
function GetContactProto(hContact: TMCONTACT; var SubContact: TMCONTACT; var SubProtocol: PAnsiChar): PAnsiChar; overload;
function GetContactDisplayName(hContact: TMCONTACT; Proto: PAnsiChar = nil; Contact: boolean = false): PWideChar;
function GetContactID(hContact: TMCONTACT; Proto: PAnsiChar = nil; Contact: boolean = false): PAnsiChar;
@@ -61,19 +60,13 @@ uses //----- Contact info -----
-function GetContactProto(hContact: TMCONTACT): PAnsiChar;
-{$IFDEF AllowInline}inline;{$ENDIF}
-begin
- Result := Proto_GetProtoName(hContact);
-end;
-
function GetContactProto(hContact: TMCONTACT; var SubContact: TMCONTACT; var SubProtocol: PAnsiChar): PAnsiChar;
begin
- Result := Proto_GetProtoName(hContact);
+ Result := Proto_GetBaseAccountName(hContact);
if StrCmp(Result, META_PROTO)=0 then
begin
SubContact := db_mc_getMostOnline(hContact);
- SubProtocol := Proto_GetProtoName(SubContact);
+ SubProtocol := Proto_GetBaseAccountName(SubContact);
end
else
begin
@@ -91,7 +84,7 @@ begin else
begin
if Proto = nil then
- Proto := GetContactProto(hContact);
+ Proto := Proto_GetBaseAccountName(hContact);
pUnk := TranslateW('''(Unknown Contact)''');
if Proto = nil then
StrDupW(Result, pUnk)
@@ -126,7 +119,7 @@ begin if not((hContact = 0) and Contact) then
begin
if Proto = nil then
- Proto := GetContactProto(hContact);
+ Proto := Proto_GetBaseAccountName(hContact);
uid := Proto_GetUniqueId(Proto);
if (uid <> nil) then
begin
@@ -158,7 +151,7 @@ end; function GetContactCodePage(hContact: TMCONTACT; Proto: PAnsiChar; var UsedDefault: boolean) : Cardinal;
begin
if Proto = nil then
- Proto := GetContactProto(hContact);
+ Proto := Proto_GetBaseAccountName(hContact);
if Proto = nil then
Result := Langpack_GetDefaultCodePage
else
@@ -183,7 +176,7 @@ function WriteContactCodePage(hContact: TMCONTACT; CodePage: Cardinal; Proto: PA begin
Result := false;
if Proto = nil then
- Proto := GetContactProto(hContact);
+ Proto := Proto_GetBaseAccountName(hContact);
if Proto = nil then
exit;
DBWriteWord(hContact, Proto, 'AnsiCodePage', CodePage);
@@ -194,7 +187,7 @@ function GetContactStatus(hContact:TMCONTACT):integer; var
szProto:PAnsiChar;
begin
- szProto:=GetContactProto(hContact);
+ szProto:=Proto_GetBaseAccountName(hContact);
if szProto=nil then
result:=ID_STATUS_OFFLINE
else
@@ -205,14 +198,14 @@ end; function IsChat(hContact:TMCONTACT):bool;
begin
- result:=DBReadByte(hContact,GetContactProto(hContact),'ChatRoom',0)=1;
+ result:=DBReadByte(hContact,Proto_GetBaseAccountName(hContact),'ChatRoom',0)=1;
end;
function IsMirandaUser(hContact:TMCONTACT):integer; // >0=Miranda; 0=Not miranda; -1=unknown
var
sz:PAnsiChar;
begin
- sz:=DBReadString(hContact,GetContactProto(hContact),'MirVer');
+ sz:=DBReadString(hContact,Proto_GetBaseAccountName(hContact),'MirVer');
if sz<>nil then
begin
result:=int_ptr(StrPos(sz,'Miranda'));
@@ -243,7 +236,7 @@ begin result:=255;
if db_mc_getMeta(hContact)<>0 then
result:=2;
- if StrCmp(GetContactProto(hContact),META_PROTO)=0 then
+ if StrCmp(Proto_GetBaseAccountName(hContact),META_PROTO)=0 then
result:=1;
end;
if Proto<>nil then
@@ -450,7 +443,7 @@ var begin
if (hContact<>0) and (db_is_contact(hContact)<>0) then
begin
- if StrCopy(pc,GetContactProto(hContact))<>nil then
+ if StrCopy(pc,Proto_GetBaseAccountName(hContact))<>nil then
if DblClk or (DBReadByte(hContact,pc,'ChatRoom',0)=1) then // chat room
begin
if not anystatus then
diff --git a/plugins/Variables/src/contact.cpp b/plugins/Variables/src/contact.cpp index b397164a29..4a1079b437 100644 --- a/plugins/Variables/src/contact.cpp +++ b/plugins/Variables/src/contact.cpp @@ -113,7 +113,7 @@ wchar_t* getContactInfoT(BYTE type, MCONTACT hContact) if (hContact == NULL)
return nullptr;
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto == nullptr)
return nullptr;
@@ -202,7 +202,7 @@ MCONTACT getContactFromString(const wchar_t *tszContact, DWORD dwFlags, int nMat tmp.Format(L"<%s:%d>", _A2W(PROTOID_HANDLE), hContact);
bool bMatch = (tmp == tszContact);
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto == nullptr)
continue;
@@ -305,7 +305,7 @@ static int contactSettingChanged(WPARAM hContact, LPARAM lParam) {
DBCONTACTWRITESETTING *dbw = (DBCONTACTWRITESETTING*)lParam;
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto == nullptr)
return 0;
@@ -357,7 +357,7 @@ int deinitContactModule() // result must be freed
wchar_t* encodeContactToString(MCONTACT hContact)
{
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto == nullptr)
return nullptr;
diff --git a/plugins/Variables/src/parse_metacontacts.cpp b/plugins/Variables/src/parse_metacontacts.cpp index 7a4d6df88c..65d53de2e1 100644 --- a/plugins/Variables/src/parse_metacontacts.cpp +++ b/plugins/Variables/src/parse_metacontacts.cpp @@ -33,7 +33,7 @@ static wchar_t* parseGetParent(ARGUMENTSINFO *ai) return nullptr;
ptrW szUniqueID;
- char* szProto = GetContactProto(hContact);
+ char* szProto = Proto_GetBaseAccountName(hContact);
if (szProto != nullptr)
szUniqueID = getContactInfoT(CNF_UNIQUEID, hContact);
@@ -61,7 +61,7 @@ static wchar_t* parseGetDefault(ARGUMENTSINFO *ai) return nullptr;
ptrW szUniqueID;
- char* szProto = GetContactProto(hContact);
+ char* szProto = Proto_GetBaseAccountName(hContact);
if (szProto != nullptr)
szUniqueID = getContactInfoT(CNF_UNIQUEID, hContact);
@@ -89,7 +89,7 @@ static wchar_t* parseGetMostOnline(ARGUMENTSINFO *ai) return nullptr;
ptrW szUniqueID;
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto != nullptr)
szUniqueID = getContactInfoT(CNF_UNIQUEID, hContact);
diff --git a/plugins/Variables/src/parse_miranda.cpp b/plugins/Variables/src/parse_miranda.cpp index 3d51668705..0e733a79ce 100644 --- a/plugins/Variables/src/parse_miranda.cpp +++ b/plugins/Variables/src/parse_miranda.cpp @@ -378,7 +378,7 @@ static wchar_t* parseSpecialContact(ARGUMENTSINFO *ai) ai->flags |= AIF_DONTPARSE;
ptrW szUniqueID;
- char *szProto = GetContactProto(ai->fi->hContact);
+ char *szProto = Proto_GetBaseAccountName(ai->fi->hContact);
if (szProto != nullptr)
szUniqueID = getContactInfoT(CNF_UNIQUEID, ai->fi->hContact);
diff --git a/plugins/Watrack/proto/proto.pas b/plugins/Watrack/proto/proto.pas index 3025ab76f3..648d1e7e26 100644 --- a/plugins/Watrack/proto/proto.pas +++ b/plugins/Watrack/proto/proto.pas @@ -111,7 +111,7 @@ begin (StrCmp(PPROTORECVEVENT(ccs^.lParam)^.szMessage.a,
wpRequest,Length(wpRequest))=0) then
begin
- StrCopy(PAnsiChar(buf),Proto_GetProtoName(ccs^.hContact));
+ StrCopy(PAnsiChar(buf),Proto_GetBaseAccountName(ccs^.hContact));
i:=DBReadWord(ccs^.hContact,PAnsiChar(buf),'ApparentMode');
if (i=ID_STATUS_OFFLINE) or
((i=0) and (Proto_GetStatus(PAnsiChar(buf))=ID_STATUS_INVISIBLE)) then
diff --git a/plugins/WhenWasIt/src/date_utils.cpp b/plugins/WhenWasIt/src/date_utils.cpp index 325f5dc895..96da0e9436 100644 --- a/plugins/WhenWasIt/src/date_utils.cpp +++ b/plugins/WhenWasIt/src/date_utils.cpp @@ -41,7 +41,7 @@ int GetContactDOB(MCONTACT hContact, int &year, int &month, int &day) if (IsDOBValid(year, month, day))
return DOB_USERINFO;
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
year = db_get_w(hContact, szProto, "BirthYear", 0);
month = db_get_b(hContact, szProto, "BirthMonth", 0);
day = db_get_b(hContact, szProto, "BirthDay", 0);
@@ -86,7 +86,7 @@ char GetContactGender(MCONTACT hContact) {
char gender = db_get_b(hContact, "UserInfo", "Gender", 'U');
if (gender == 'U')
- gender = db_get_b(hContact, GetContactProto(hContact), "Gender", 'U');
+ gender = db_get_b(hContact, Proto_GetBaseAccountName(hContact), "Gender", 'U');
return gender;
}
@@ -194,7 +194,7 @@ int SaveBirthday(MCONTACT hContact, int year, int month, int day, int mode) char *sYear, *sdYear, *sd2Year;
char *sMonth, *sdMonth, *sd2Month;
char *sDay, *sdDay, *sd2Day;
- char *protocol = GetContactProto(hContact);
+ char *protocol = Proto_GetBaseAccountName(hContact);
switch (mode) {
case SAVE_MODE_MBIRTHDAY:
diff --git a/plugins/WhenWasIt/src/dlg_handlers.cpp b/plugins/WhenWasIt/src/dlg_handlers.cpp index 0ce375b103..3e16ad0eeb 100644 --- a/plugins/WhenWasIt/src/dlg_handlers.cpp +++ b/plugins/WhenWasIt/src/dlg_handlers.cpp @@ -408,7 +408,7 @@ INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l {
wchar_t *szTooltipText = TranslateT("Please select the module where you want the date of birth to be saved.\r\n\"UserInfo\" is the default location.\r\nUse \"Protocol module\" to make the data visible in User Details.\n\"mBirthday module\" uses the same module as mBirthday plugin.");
wchar_t *szCurrentModuleTooltip = nullptr;
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
wchar_t buffer[2048];
mir_snwprintf(buffer, TranslateT("Set birthday for %s:"), Clist_GetContactDisplayName(hContact));
@@ -584,7 +584,7 @@ int UpdateBirthdayEntry(HWND hList, MCONTACT hContact, int entry, int bShowAll, if (month > currentMonth || (month == currentMonth) && (day > currentDay)) // birthday still to come
age--;
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
PROTOACCOUNT *pAcc = Proto_GetAccount(szProto);
wchar_t *ptszAccName = (pAcc == nullptr) ? TranslateT("Unknown") : pAcc->tszAccountName;
diff --git a/plugins/WhenWasIt/src/services.cpp b/plugins/WhenWasIt/src/services.cpp index e0f459d225..9c3770f100 100644 --- a/plugins/WhenWasIt/src/services.cpp +++ b/plugins/WhenWasIt/src/services.cpp @@ -303,7 +303,7 @@ int DoExport(wchar_t *fileName) int year, month, day;
GetContactDOB(hContact, year, month, day);
if (IsDOBValid(year, month, day)) {
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
wchar_t *szHandle = GetContactID(hContact, szProto);
if ((szHandle) && (mir_strlen(szProto) > 0))
diff --git a/plugins/WhenWasIt/src/utils.cpp b/plugins/WhenWasIt/src/utils.cpp index 4b6240ae69..9a5cd03e16 100644 --- a/plugins/WhenWasIt/src/utils.cpp +++ b/plugins/WhenWasIt/src/utils.cpp @@ -152,7 +152,7 @@ wchar_t* GetContactID(MCONTACT hContact, char *szProto) MCONTACT GetContactFromID(wchar_t *szID, char *szProto)
{
for (auto &hContact : Contacts()) {
- char *m_szProto = GetContactProto(hContact);
+ char *m_szProto = Proto_GetBaseAccountName(hContact);
wchar_t *szHandle = GetContactID(hContact, szProto);
if (szHandle) {
bool found = (!mir_wstrcmpi(szHandle, szID) && !_stricmp(szProto, m_szProto));
diff --git a/plugins/WinterSpeak/src/SpeakAnnounce.cpp b/plugins/WinterSpeak/src/SpeakAnnounce.cpp index e9b8160138..69e9687eef 100644 --- a/plugins/WinterSpeak/src/SpeakAnnounce.cpp +++ b/plugins/WinterSpeak/src/SpeakAnnounce.cpp @@ -23,7 +23,7 @@ void SpeakAnnounce::statusChange(DBCONTACTWRITESETTING *write_setting, MCONTACT return;
// check if we just connected, and want to suppress status changes
- if (!m_db.getStatusFlag(AnnounceDatabase::StatusFlag_SuppressConnect) && m_protocol_info.isDisabled(GetContactProto(user)))
+ if (!m_db.getStatusFlag(AnnounceDatabase::StatusFlag_SuppressConnect) && m_protocol_info.isDisabled(Proto_GetBaseAccountName(user)))
return;
bool speak = false;
diff --git a/plugins/WinterSpeak/src/SpeakConfig.cpp b/plugins/WinterSpeak/src/SpeakConfig.cpp index c9bc28f878..ef19850752 100644 --- a/plugins/WinterSpeak/src/SpeakConfig.cpp +++ b/plugins/WinterSpeak/src/SpeakConfig.cpp @@ -50,7 +50,7 @@ bool SpeakConfig::say(const std::wstring &sentence, MCONTACT user, bool message) if (NULL != user)
{
// get the status of the protocol of this user
- const char *protocol = GetContactProto(user);
+ const char *protocol = Proto_GetBaseAccountName(user);
switch (Proto_GetStatus(protocol)) {
case ID_STATUS_ONLINE:
diff --git a/plugins/XSoundNotify/src/dialog.cpp b/plugins/XSoundNotify/src/dialog.cpp index 92da7e0041..39db3a53c7 100644 --- a/plugins/XSoundNotify/src/dialog.cpp +++ b/plugins/XSoundNotify/src/dialog.cpp @@ -22,7 +22,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
WindowList_Add(hChangeSoundDlgList, hwndDlg, hContact);
Utils_RestoreWindowPositionNoSize(hwndDlg, hContact, MODULENAME, "ChangeSoundDlg");
- char* szProto = GetContactProto(hContact);
+ char* szProto = Proto_GetBaseAccountName(hContact);
PROTOACCOUNT *pa = Proto_GetAccount(szProto);
const char* szUniqueId = Proto_GetUniqueId(pa->szModuleName);
if (szUniqueId != nullptr) {
diff --git a/plugins/XSoundNotify/src/xsn_main.cpp b/plugins/XSoundNotify/src/xsn_main.cpp index 3437461d9f..8f3396823f 100644 --- a/plugins/XSoundNotify/src/xsn_main.cpp +++ b/plugins/XSoundNotify/src/xsn_main.cpp @@ -114,7 +114,7 @@ static int ProcessEvent(WPARAM hContact, LPARAM lParam) return 0;
}
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
PROTOACCOUNT *pa = Proto_GetAccount(szProto);
size_t value_max_len = mir_strlen(pa->szModuleName) + 8;
char *value = (char *)mir_alloc(sizeof(char) * value_max_len);
@@ -159,7 +159,7 @@ static int ProcessChatEvent(WPARAM, LPARAM lParam) isOwnSound = 1;
return 0;
}
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
PROTOACCOUNT *pa = Proto_GetAccount(szProto);
size_t value_max_len = mir_strlen(pa->szModuleName) + 8;
char *value = (char *)mir_alloc(sizeof(char) * value_max_len);
@@ -217,7 +217,7 @@ static int PrebuildContactMenu(WPARAM wParam, LPARAM) {
MCONTACT hContact = wParam;
if (hContact) {
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
PROTOACCOUNT *pa = Proto_GetAccount(szProto);
Menu_ShowItem(hChangeSound, IsSuitableProto(pa));
}
diff --git a/plugins/mRadio/i_optdlg.inc b/plugins/mRadio/i_optdlg.inc index 5146b57adc..fe26a0bf11 100644 --- a/plugins/mRadio/i_optdlg.inc +++ b/plugins/mRadio/i_optdlg.inc @@ -681,7 +681,7 @@ begin begin
if value._type=DBVT_DELETED then
begin
- if StrCmp(Proto_GetProtoName(wParam),PluginName)<>0 then exit;
+ if StrCmp(Proto_GetBaseAccountName(wParam),PluginName)<>0 then exit;
pc:=DBReadString(wParam,PluginName,optNick);
DBWriteString(wParam,strCList,optMyHandle,pc);
@@ -695,7 +695,7 @@ begin if StrCmp(szSetting,optAge)=0 then
begin
- if StrCmp(Proto_GetProtoName(wParam),PluginName)<>0 then exit;
+ if StrCmp(Proto_GetBaseAccountName(wParam),PluginName)<>0 then exit;
if value._type=DBVT_DELETED then
i:=DBReadWord(wParam,PluginName,optAge)
else
@@ -709,7 +709,7 @@ begin DBVT_ASCIIZ ,
DBVT_WCHAR ,
DBVT_UTF8 :
- if StrCmp(Proto_GetProtoName(wParam),PluginName)<>0 then exit;
+ if StrCmp(Proto_GetBaseAccountName(wParam),PluginName)<>0 then exit;
else
exit;
end;
diff --git a/plugins/mRadio/i_visual.inc b/plugins/mRadio/i_visual.inc index e8a319d15c..06dd42aaa1 100644 --- a/plugins/mRadio/i_visual.inc +++ b/plugins/mRadio/i_visual.inc @@ -5,7 +5,7 @@ var function OnContactMenu(hContact:WPARAM;lParam:LPARAM):int;cdecl;
begin
- if StrCmp(Proto_GetProtoName(hContact),PluginName)<>0 then
+ if StrCmp(Proto_GetBaseAccountName(hContact),PluginName)<>0 then
begin
Menu_ShowItem(hCMenuItemRec, 0);
Menu_ShowItem(hCMenuItemPlay, 0);
|