diff options
author | George Hazan <george.hazan@gmail.com> | 2013-07-20 13:23:20 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-07-20 13:23:20 +0000 |
commit | d7382326906b9f3bdd66704dd1b41f9299c1daa6 (patch) | |
tree | ccc0696d8ec511b4894cf2b20971b9f7fc625689 /protocols/Gadu-Gadu/src/core.cpp | |
parent | 874cdbe42cfe376f0e72fd5fe6bad0d2f75f4ee3 (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/Gadu-Gadu/src/core.cpp')
-rw-r--r-- | protocols/Gadu-Gadu/src/core.cpp | 14 |
1 files changed, 5 insertions, 9 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");
|