summaryrefslogtreecommitdiff
path: root/protocols/AimOscar/src/theme.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-07-20 13:23:20 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-07-20 13:23:20 +0000
commitd7382326906b9f3bdd66704dd1b41f9299c1daa6 (patch)
treeccc0696d8ec511b4894cf2b20971b9f7fc625689 /protocols/AimOscar/src/theme.cpp
parent874cdbe42cfe376f0e72fd5fe6bad0d2f75f4ee3 (diff)
protocol helper for detecting chats: isChatRoom
git-svn-id: http://svn.miranda-ng.org/main/trunk@5428 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/AimOscar/src/theme.cpp')
-rw-r--r--protocols/AimOscar/src/theme.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/protocols/AimOscar/src/theme.cpp b/protocols/AimOscar/src/theme.cpp
index 02e1f652bd..495ac46299 100644
--- a/protocols/AimOscar/src/theme.cpp
+++ b/protocols/AimOscar/src/theme.cpp
@@ -122,7 +122,7 @@ static const char* extra_ES_icon_name[2] =
static void set_AT_icon(CAimProto* ppro, HANDLE hContact)
{
- if (ppro->getByte(hContact, "ChatRoom", 0)) return;
+ if (ppro->isChatRoom(hContact)) return;
unsigned i = ppro->getByte(hContact, AIM_KEY_AC, 0) - 1;
ExtraIcon_SetIcon(hExtraAT, hContact, (i < 5) ? GetIconHandle(extra_AT_icon_name[i]) : NULL);
@@ -130,7 +130,7 @@ static void set_AT_icon(CAimProto* ppro, HANDLE hContact)
static void set_ES_icon(CAimProto* ppro, HANDLE hContact)
{
- if (ppro->getByte(hContact, "ChatRoom", 0)) return;
+ if (ppro->isChatRoom(hContact)) return;
unsigned i = ppro->getByte(hContact, AIM_KEY_ET, 0) - 1;
ExtraIcon_SetIcon(hExtraAT, hContact, (i < 2) ? GetIconHandle(extra_ES_icon_name[i]) : NULL);
@@ -145,14 +145,14 @@ void set_contact_icon(CAimProto* ppro, HANDLE hContact)
void remove_AT_icons(CAimProto* ppro)
{
for (HANDLE hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName))
- if (!ppro->getByte(hContact, "ChatRoom", 0))
+ if (!ppro->isChatRoom(hContact))
ExtraIcon_Clear(hExtraAT, hContact);
}
void remove_ES_icons(CAimProto* ppro)
{
for (HANDLE hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName))
- if (!ppro->getByte(hContact, "ChatRoom", 0))
+ if (!ppro->isChatRoom(hContact))
ExtraIcon_Clear(hExtraES, hContact);
}
@@ -203,11 +203,11 @@ void InitThemeSupport(void)
int CAimProto::OnPreBuildContactMenu(WPARAM wParam,LPARAM /*lParam*/)
{
HANDLE hContact = (HANDLE)wParam;
- bool isChatRoom = getByte(hContact, "ChatRoom", 0) != 0;
+ bool bIsChatRoom = isChatRoom(hContact);
//see if we should add the html away message context menu items
- Menu_ShowItem(hHTMLAwayContextMenuItem, getWord(hContact, AIM_KEY_ST, ID_STATUS_OFFLINE) == ID_STATUS_AWAY && !isChatRoom);
- Menu_ShowItem(hAddToServerListContextMenuItem, !getBuddyId(hContact, 1) && state != 0 && !isChatRoom);
+ Menu_ShowItem(hHTMLAwayContextMenuItem, getWord(hContact, AIM_KEY_ST, ID_STATUS_OFFLINE) == ID_STATUS_AWAY && !bIsChatRoom);
+ Menu_ShowItem(hAddToServerListContextMenuItem, !getBuddyId(hContact, 1) && state != 0 && !bIsChatRoom);
DBVARIANT dbv;
if (!getString(hContact, AIM_KEY_SN, &dbv)) {