summaryrefslogtreecommitdiff
path: root/protocols/Gadu-Gadu
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Gadu-Gadu')
-rw-r--r--protocols/Gadu-Gadu/src/core.cpp14
-rw-r--r--protocols/Gadu-Gadu/src/dialogs.cpp10
-rw-r--r--protocols/Gadu-Gadu/src/gg.cpp3
-rw-r--r--protocols/Gadu-Gadu/src/import.cpp2
4 files changed, 14 insertions, 15 deletions
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp
index 03d23031ed..63b5c14735 100644
--- a/protocols/Gadu-Gadu/src/core.cpp
+++ b/protocols/Gadu-Gadu/src/core.cpp
@@ -1293,14 +1293,11 @@ void GGPROTO::broadcastnewstatus(int newStatus)
int GGPROTO::contactdeleted(WPARAM wParam, LPARAM lParam)
{
HANDLE hContact = (HANDLE) wParam;
- uin_t uin; int type;
- DBVARIANT dbv;
-
- uin = (uin_t)getDword(hContact, GG_KEY_UIN, 0);
- type = getByte(hContact, "ChatRoom", 0);
+ uin_t uin = (uin_t)getDword(hContact, GG_KEY_UIN, 0);
// Terminate conference if contact is deleted
- if (type && !getTString(hContact, "ChatRoomID", &dbv) && gc_enabled)
+ DBVARIANT dbv;
+ if ( isChatRoom(hContact) && !getTString(hContact, "ChatRoomID", &dbv) && gc_enabled)
{
GCDEST gcdest = {0};
gcdest.pszModule = m_szModuleName;
@@ -1378,8 +1375,7 @@ int GGPROTO::dbsettingchanged(WPARAM wParam, LPARAM lParam)
// Groupchat window contact is being renamed
DBVARIANT dbv;
- int type = getByte(hContact, "ChatRoom", 0);
- if (type && !getTString(hContact, "ChatRoomID", &dbv))
+ if (isChatRoom(hContact) && !getTString(hContact, "ChatRoomID", &dbv))
{
// Most important... check redundancy (fucking cascading)
static int cascade = 0;
@@ -1561,7 +1557,7 @@ HANDLE GGPROTO::getcontact(uin_t uin, int create, int inlist, TCHAR *szNick)
#endif
// Look for contact in DB
for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
- if ((uin_t)getDword(hContact, GG_KEY_UIN, 0) == uin && !getByte(hContact, "ChatRoom", 0)) {
+ if ((uin_t)getDword(hContact, GG_KEY_UIN, 0) == uin && !isChatRoom(hContact)) {
if (inlist) {
db_unset(hContact, "CList", "NotOnList");
db_unset(hContact, "CList", "Hidden");
diff --git a/protocols/Gadu-Gadu/src/dialogs.cpp b/protocols/Gadu-Gadu/src/dialogs.cpp
index 55d531e6af..ffc5c96f4e 100644
--- a/protocols/Gadu-Gadu/src/dialogs.cpp
+++ b/protocols/Gadu-Gadu/src/dialogs.cpp
@@ -907,9 +907,13 @@ static INT_PTR CALLBACK gg_detailsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam,
int GGPROTO::details_init(WPARAM wParam, LPARAM lParam)
{
- char* szProto = GetContactProto((HANDLE)lParam);
- if ((szProto == NULL || strcmp(szProto, m_szModuleName)) && lParam || lParam && db_get_b((HANDLE)lParam, m_szModuleName, "ChatRoom", 0))
- return 0;
+ HANDLE hContact = (HANDLE)lParam;
+ char* szProto = GetContactProto(hContact);
+ if (szProto == NULL)
+ return 0;
+
+ if (hContact && (strcmp(szProto, m_szModuleName) || isChatRoom(hContact)))
+ return 0;
// Here goes init
OPTIONSDIALOGPAGE odp = { sizeof(odp) };
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp
index 697ab3d8e0..836384139c 100644
--- a/protocols/Gadu-Gadu/src/gg.cpp
+++ b/protocols/Gadu-Gadu/src/gg.cpp
@@ -234,8 +234,7 @@ static int gg_prebuildcontactmenu(WPARAM wParam, LPARAM lParam)
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_NAME | CMIM_FLAGS | CMIF_TCHAR;
if ( gg->getDword(hContact, GG_KEY_UIN, 0) == gg->getByte(GG_KEY_UIN, 0) ||
- gg->getByte(hContact, "ChatRoom", 0) ||
- db_get_b(hContact, "CList", "NotOnList", 0))
+ gg->isChatRoom(hContact) || db_get_b(hContact, "CList", "NotOnList", 0))
mi.flags |= CMIF_HIDDEN;
mi.ptszName = gg->getByte(hContact, GG_KEY_BLOCK, 0) ? LPGENT("&Unblock") : LPGENT("&Block");
Menu_ModifyItem(gg->hBlockMenuItem, &mi);
diff --git a/protocols/Gadu-Gadu/src/import.cpp b/protocols/Gadu-Gadu/src/import.cpp
index d6b2e84afd..d19d5abaea 100644
--- a/protocols/Gadu-Gadu/src/import.cpp
+++ b/protocols/Gadu-Gadu/src/import.cpp
@@ -102,7 +102,7 @@ char *gg_makecontacts(GGPROTO *gg, int cr)
// Readup contacts
for (HANDLE hContact = db_find_first(gg->m_szModuleName); hContact; hContact = db_find_next(hContact, gg->m_szModuleName)) {
- if (gg->getByte(hContact, "ChatRoom", 0))
+ if (gg->isChatRoom(hContact))
continue;
// Readup FirstName