summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Gadu-Gadu/src/core.cpp31
-rw-r--r--protocols/Gadu-Gadu/src/gg.h248
-rw-r--r--protocols/Gadu-Gadu/src/options.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/userinfo.cpp4
-rw-r--r--protocols/Gadu-Gadu/src/version.h4
5 files changed, 141 insertions, 148 deletions
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp
index 1b5ab5c32d..b57a06fe19 100644
--- a/protocols/Gadu-Gadu/src/core.cpp
+++ b/protocols/Gadu-Gadu/src/core.cpp
@@ -611,17 +611,18 @@ retry:
for (int i = 0; i < count; i++) {
// Loadup fields
const char *__fmnumber = gg_pubdir50_get(res, i, GG_PUBDIR50_UIN);
- wchar_t *__nickname = mir_utf8decodeW(gg_pubdir50_get(res, i, GG_PUBDIR50_NICKNAME));
- wchar_t *__firstname = mir_utf8decodeW(gg_pubdir50_get(res, i, GG_PUBDIR50_FIRSTNAME));
- wchar_t *__lastname = mir_utf8decodeW(gg_pubdir50_get(res, i, GG_PUBDIR50_LASTNAME));
- wchar_t *__familyname = mir_utf8decodeW(gg_pubdir50_get(res, i, GG_PUBDIR50_FAMILYNAME));
- wchar_t *__city = mir_utf8decodeW(gg_pubdir50_get(res, i, GG_PUBDIR50_CITY));
- wchar_t *__familycity = mir_utf8decodeW(gg_pubdir50_get(res, i, GG_PUBDIR50_FAMILYCITY));
const char *__birthyear = gg_pubdir50_get(res, i, GG_PUBDIR50_BIRTHYEAR);
const char *__gender = gg_pubdir50_get(res, i, GG_PUBDIR50_GENDER);
const char *__status = gg_pubdir50_get(res, i, GG_PUBDIR50_STATUS);
uin_t uin = __fmnumber ? atoi(__fmnumber) : 0;
+ ptrW __nickname(mir_utf8decodeW(gg_pubdir50_get(res, i, GG_PUBDIR50_NICKNAME)));
+ ptrW __firstname(mir_utf8decodeW(gg_pubdir50_get(res, i, GG_PUBDIR50_FIRSTNAME)));
+ ptrW __lastname(mir_utf8decodeW(gg_pubdir50_get(res, i, GG_PUBDIR50_LASTNAME)));
+ ptrW __familyname(mir_utf8decodeW(gg_pubdir50_get(res, i, GG_PUBDIR50_FAMILYNAME)));
+ ptrW __city(mir_utf8decodeW(gg_pubdir50_get(res, i, GG_PUBDIR50_CITY)));
+ ptrW __familycity(mir_utf8decodeW(gg_pubdir50_get(res, i, GG_PUBDIR50_FAMILYCITY)));
+
MCONTACT hContact = (res->seq == GG_SEQ_CHINFO) ? NULL : getcontact(uin, 0, 0, nullptr);
debugLogA("mainthread() (%x): Search result for uin %d, seq %d.", this, uin, res->seq);
if (res->seq == GG_SEQ_SEARCH) {
@@ -654,7 +655,7 @@ retry:
psr.email.w = strFmt2;
psr.id.w = _ultow(uin, strFmt1, 10);
psr.uin = uin;
- ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)1, (LPARAM)&psr);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, this, (LPARAM)&psr);
}
if (((res->seq == GG_SEQ_INFO || res->seq == GG_SEQ_GETNICK) && hContact != NULL)
@@ -713,32 +714,26 @@ retry:
// Gadu-Gadu Male <-> Female
if (__gender) {
if (res->seq == GG_SEQ_CHINFO)
- setByte(hContact, GG_KEY_PD_GANDER,
+ setByte(hContact, GG_KEY_PD_GENDER,
(uint8_t)(!mir_strcmp(__gender, GG_PUBDIR50_GENDER_SET_MALE) ? 'M' :
(!mir_strcmp(__gender, GG_PUBDIR50_GENDER_SET_FEMALE) ? 'F' : '?')));
else
- setByte(hContact, GG_KEY_PD_GANDER,
+ setByte(hContact, GG_KEY_PD_GENDER,
(uint8_t)(!mir_strcmp(__gender, GG_PUBDIR50_GENDER_MALE) ? 'M' :
(!mir_strcmp(__gender, GG_PUBDIR50_GENDER_FEMALE) ? 'F' : '?')));
}
else if (res->seq == GG_SEQ_CHINFO) {
- delSetting(GG_KEY_PD_GANDER);
+ delSetting(GG_KEY_PD_GENDER);
}
debugLogA("mainthread() (%x): Setting user info for uin %d.", this, uin);
ProtoBroadcastAck(hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1);
}
-
- if (__nickname) mir_free(__nickname);
- if (__firstname) mir_free(__firstname);
- if (__lastname) mir_free(__lastname);
- if (__familyname) mir_free(__familyname);
- if (__city) mir_free(__city);
- if (__familycity) mir_free(__familycity);
}
}
+
if (res->seq == GG_SEQ_SEARCH)
- ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)1, 0);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, this, 0);
break;
}
diff --git a/protocols/Gadu-Gadu/src/gg.h b/protocols/Gadu-Gadu/src/gg.h
index 870af10e41..757feeda92 100644
--- a/protocols/Gadu-Gadu/src/gg.h
+++ b/protocols/Gadu-Gadu/src/gg.h
@@ -127,144 +127,142 @@ struct GGGETAVATARDATA
};
// Wrappers of the old interface
-#define GGDEF_PROTO "GG" // Default Proto
-#define GGDEF_PROTONAME "Gadu-Gadu" // Default ProtoName
+#define GGDEF_PROTO "GG" // Default Proto
+#define GGDEF_PROTONAME "Gadu-Gadu" // Default ProtoName
// Process handles / seqs
-#define GG_SEQ_INFO 100
-#define GG_SEQ_SEARCH 200
-#define GG_SEQ_GETNICK 300
-#define GG_SEQ_CHINFO 400
+#define GG_SEQ_INFO 100
+#define GG_SEQ_SEARCH 200
+#define GG_SEQ_GETNICK 300
+#define GG_SEQ_CHINFO 400
// Services
-#define GGS_IMPORT_SERVER "/ImportFromServer"
-#define GGS_REMOVE_SERVER "/RemoveFromServer"
-#define GGS_IMPORT_TEXT "/ImportFromText"
-#define GGS_EXPORT_SERVER "/ExportFromServer"
-#define GGS_EXPORT_TEXT "/ExportFromText"
+#define GGS_IMPORT_SERVER "/ImportFromServer"
+#define GGS_REMOVE_SERVER "/RemoveFromServer"
+#define GGS_IMPORT_TEXT "/ImportFromText"
+#define GGS_EXPORT_SERVER "/ExportFromServer"
+#define GGS_EXPORT_TEXT "/ExportFromText"
-#define GGS_SENDIMAGE "/SendImage"
-#define GGS_RECVIMAGE "/RecvImage"
+#define GGS_SENDIMAGE "/SendImage"
+#define GGS_RECVIMAGE "/RecvImage"
// Keys
-#define GG_PLUGINVERSION "Version" // Plugin version.. used for cleanup from previous versions
-
-#define GG_KEY_UIN "UIN" // Uin - unique number
-#define GG_KEY_PASSWORD "Password" // Password
-#define GG_KEY_EMAIL "e-mail" // E-mail
-#define GG_KEY_STATUS "Status" // Status
-#define GG_KEY_NICK "Nick" // Nick
-#define GG_KEY_STATUSDESCR "StatusMsg" // Users status description, to be compatible with MWClist
- // should be stored in "CList" group
-#define GG_KEY_TOKEN "Token" // OAuth Access Token
-#define GG_KEY_TOKENSECRET "TokenSecret" // OAuth Access Token Secret
-
-#define GG_KEY_LEAVESTATUSMSG "LeaveStatusMsg"// Leave status msg when disconnected
-#define GG_KEYDEF_LEAVESTATUSMSG 0
-#define GG_KEY_LEAVESTATUS "LeaveStatus"
-#define GG_KEYDEF_LEAVESTATUS 0
-
-#define GG_KEY_FRIENDSONLY "FriendsOnly" // Friend only visibility
-#define GG_KEYDEF_FRIENDSONLY 0
-
-#define GG_KEY_SHOWLINKS "ShowLinks" // Show links from unknown contacts
-#define GG_KEYDEF_SHOWLINKS 0
-
-#define GG_KEY_ENABLEAVATARS "EnableAvatars" // Enable avatars support
-#define GG_KEYDEF_ENABLEAVATARS 1
-
-#define GG_KEY_AVATARHASH "AvatarHash" // Contact's avatar hash
-
-#define GG_KEY_AVATARURL "AvatarURL" // Contact's avatar URL
-
-#define GG_KEY_AVATARTS "AvatarTs" // Contact's avatar Timestamp
-
-#define GG_KEY_AVATARTYPE "AvatarType" // Contact's avatar format
-#define GG_KEY_AVATARTYPEPREV "AvatarTypePrev" // Contact's previous avatar format (during setting new avatar)
-#define GG_KEYDEF_AVATARTYPE PA_FORMAT_UNKNOWN
-
-#define GG_KEY_AVATARREQUESTED "AvatarRequested" // When contact's avatar is requested
-#define GG_KEYDEF_AVATARREQUESTED 0
-
-#define GG_KEY_SHOWINVISIBLE "ShowInvisible" // Show invisible users when described
-#define GG_KEYDEF_SHOWINVISIBLE 0
-
-#define GG_KEY_IGNORECONF "IgnoreConf" // Ignore incoming conference messages
-#define GG_KEYDEF_IGNORECONF 0
-
-#define GG_KEY_IMGRECEIVE "ReceiveImg" // Popup image window automatically
-#define GG_KEYDEF_IMGRECEIVE 1
-
-#define GG_KEY_IMGMETHOD "PopupImg" // Popup image window automatically
-#define GG_KEYDEF_IMGMETHOD 1
+#define GG_PLUGINVERSION "Version" // Plugin version.. used for cleanup from previous versions
+
+#define GG_KEY_UIN "UIN" // Uin - unique number
+#define GG_KEY_PASSWORD "Password" // Password
+#define GG_KEY_EMAIL "e-mail" // E-mail
+#define GG_KEY_STATUS "Status" // Status
+#define GG_KEY_NICK "Nick" // Nick
+#define GG_KEY_STATUSDESCR "StatusMsg" // Users status description, to be compatible with MWClist
+ // should be stored in "CList" group
+#define GG_KEY_TOKEN "Token" // OAuth Access Token
+#define GG_KEY_TOKENSECRET "TokenSecret" // OAuth Access Token Secret
+
+#define GG_KEY_LEAVESTATUSMSG "LeaveStatusMsg" // Leave status msg when disconnected
+#define GG_KEYDEF_LEAVESTATUSMSG 0
+#define GG_KEY_LEAVESTATUS "LeaveStatus"
+#define GG_KEYDEF_LEAVESTATUS 0
+
+#define GG_KEY_FRIENDSONLY "FriendsOnly" // Friend only visibility
+#define GG_KEYDEF_FRIENDSONLY 0
+
+#define GG_KEY_SHOWLINKS "ShowLinks" // Show links from unknown contacts
+#define GG_KEYDEF_SHOWLINKS 0
+
+#define GG_KEY_ENABLEAVATARS "EnableAvatars" // Enable avatars support
+#define GG_KEYDEF_ENABLEAVATARS 1
+
+#define GG_KEY_AVATARHASH "AvatarHash" // Contact's avatar hash
+
+#define GG_KEY_AVATARURL "AvatarURL" // Contact's avatar URL
+
+#define GG_KEY_AVATARTS "AvatarTs" // Contact's avatar Timestamp
+
+#define GG_KEY_AVATARTYPE "AvatarType" // Contact's avatar format
+#define GG_KEY_AVATARTYPEPREV "AvatarTypePrev" // Contact's previous avatar format (during setting new avatar)
+#define GG_KEYDEF_AVATARTYPE PA_FORMAT_UNKNOWN
+
+#define GG_KEY_AVATARREQUESTED "AvatarRequested" // When contact's avatar is requested
+#define GG_KEYDEF_AVATARREQUESTED 0
+
+#define GG_KEY_SHOWINVISIBLE "ShowInvisible" // Show invisible users when described
+#define GG_KEYDEF_SHOWINVISIBLE 0
+
+#define GG_KEY_IGNORECONF "IgnoreConf" // Ignore incoming conference messages
+#define GG_KEYDEF_IGNORECONF 0
+
+#define GG_KEY_IMGRECEIVE "ReceiveImg" // Popup image window automatically
+#define GG_KEYDEF_IMGRECEIVE 1
+
+#define GG_KEY_IMGMETHOD "PopupImg" // Popup image window automatically
+#define GG_KEYDEF_IMGMETHOD 1
// newline separated list of hosts for server connection
-#define GG_KEYDEF_SERVERHOSTS \
- L"ggproxy-secure-10.gadu-gadu.pl\r\n" \
- L"ggproxy-secure-11.gadu-gadu.pl\r\n" \
- L"ggproxy-secure-12.gadu-gadu.pl\r\n" \
- L"ggproxy-secure-13.gadu-gadu.pl\r\n" \
- L"ggproxy-secure-14.gadu-gadu.pl\r\n" \
- L"ggproxy-secure-15.gadu-gadu.pl\r\n" \
- L"ggproxy-secure-16.gadu-gadu.pl\r\n" \
- L"ggproxy-secure-17.gadu-gadu.pl\r\n" \
- L"ggproxy-secure-18.gadu-gadu.pl"
-
-#define GG_KEY_CLIENTIP "IP" // Contact IP (by notify)
-#define GG_KEY_CLIENTPORT "ClientPort" // Contact port
-#define GG_KEY_CLIENTVERSION "ClientVersion" // Contact app version
-
-#define GG_KEY_GC_POLICY_UNKNOWN "GCPolicyUnknown"
-#define GG_KEYDEF_GC_POLICY_UNKNOWN 1
-
-#define GG_KEY_GC_COUNT_UNKNOWN "GCCountUnknown"
-#define GG_KEYDEF_GC_COUNT_UNKNOWN 5
-
-#define GG_KEY_GC_POLICY_TOTAL "GCPolicyTotal"
-#define GG_KEYDEF_GC_POLICY_TOTAL 1
-
-#define GG_KEY_GC_COUNT_TOTAL "GCCountTotal"
-#define GG_KEYDEF_GC_COUNT_TOTAL 10
-
-#define GG_KEY_GC_POLICY_DEFAULT "GCPolicyDefault"
-#define GG_KEYDEF_GC_POLICY_DEFAULT 0
-
-#define GG_KEY_BLOCK "Block" // Contact is blocked
-#define GG_KEY_APPARENT "ApparentMode" // Visible list
-
-#define GG_KEY_TIMEDEVIATION "TimeDeviation" // Max time deviation for connections (seconds)
-#define GG_KEYDEF_TIMEDEVIATION 300
-
-#define GG_KEY_LOGONTIME "LogonTS"
-
-#define GG_KEY_RECONNINTERVAL "ReconnectInterval"
-#define GG_KEYDEF_RECONNINTERVAL 3000
-
-
-#define GG_KEY_PD_NICKNAME "NickName" // GG Public directory: Nick name
-#define GG_KEY_PD_FIRSTNAME "FirstName" // GG Public directory: First name
-#define GG_KEY_PD_LASTNAME "LastName" // GG Public directory: Last name
-#define GG_KEY_PD_FAMILYNAME "FamilyName" // GG Public directory: Family name
-#define GG_KEY_PD_CITY "City" // GG Public directory: City
-#define GG_KEY_PD_FAMILYCITY "CityOrigin" // GG Public directory: Family city
-
-#define GG_KEY_PD_AGE "Age" // GG Public directory: Age
-#define GG_KEY_PD_BIRTHYEAR "BirthYear" // GG Public directory: Birth year
-#define GG_KEY_PD_GANDER "Gender" // GG Public directory: Gander
-
+#define GG_KEYDEF_SERVERHOSTS \
+ L"ggproxy-secure-10.gadu-gadu.pl\r\n" \
+ L"ggproxy-secure-11.gadu-gadu.pl\r\n" \
+ L"ggproxy-secure-12.gadu-gadu.pl\r\n" \
+ L"ggproxy-secure-13.gadu-gadu.pl\r\n" \
+ L"ggproxy-secure-14.gadu-gadu.pl\r\n" \
+ L"ggproxy-secure-15.gadu-gadu.pl\r\n" \
+ L"ggproxy-secure-16.gadu-gadu.pl\r\n" \
+ L"ggproxy-secure-17.gadu-gadu.pl\r\n" \
+ L"ggproxy-secure-18.gadu-gadu.pl"
+
+#define GG_KEY_CLIENTIP "IP" // Contact IP (by notify)
+#define GG_KEY_CLIENTPORT "ClientPort" // Contact port
+#define GG_KEY_CLIENTVERSION "ClientVersion" // Contact app version
+
+#define GG_KEY_GC_POLICY_UNKNOWN "GCPolicyUnknown"
+#define GG_KEYDEF_GC_POLICY_UNKNOWN 1
+
+#define GG_KEY_GC_COUNT_UNKNOWN "GCCountUnknown"
+#define GG_KEYDEF_GC_COUNT_UNKNOWN 5
+
+#define GG_KEY_GC_POLICY_TOTAL "GCPolicyTotal"
+#define GG_KEYDEF_GC_POLICY_TOTAL 1
+
+#define GG_KEY_GC_COUNT_TOTAL "GCCountTotal"
+#define GG_KEYDEF_GC_COUNT_TOTAL 10
+
+#define GG_KEY_GC_POLICY_DEFAULT "GCPolicyDefault"
+#define GG_KEYDEF_GC_POLICY_DEFAULT 0
+
+#define GG_KEY_BLOCK "Block" // Contact is blocked
+#define GG_KEY_APPARENT "ApparentMode" // Visible list
+
+#define GG_KEY_TIMEDEVIATION "TimeDeviation" // Max time deviation for connections (seconds)
+#define GG_KEYDEF_TIMEDEVIATION 300
+
+#define GG_KEY_LOGONTIME "LogonTS"
+
+#define GG_KEY_RECONNINTERVAL "ReconnectInterval"
+#define GG_KEYDEF_RECONNINTERVAL 3000
+
+#define GG_KEY_PD_NICKNAME "NickName" // GG Public directory: Nick name
+#define GG_KEY_PD_FIRSTNAME "FirstName" // GG Public directory: First name
+#define GG_KEY_PD_LASTNAME "LastName" // GG Public directory: Last name
+#define GG_KEY_PD_FAMILYNAME "FamilyName" // GG Public directory: Family name
+#define GG_KEY_PD_CITY "City" // GG Public directory: City
+#define GG_KEY_PD_FAMILYCITY "CityOrigin" // GG Public directory: Family city
+
+#define GG_KEY_PD_AGE "Age" // GG Public directory: Age
+#define GG_KEY_PD_BIRTHYEAR "BirthYear" // GG Public directory: Birth year
+#define GG_KEY_PD_GENDER "Gender" // GG Public directory: Gander
// chpassdlgproc() multipurpose dialog proc modes
-#define GG_USERUTIL_PASS 0
-#define GG_USERUTIL_CREATE 1
-#define GG_USERUTIL_REMOVE 2
-#define GG_USERUTIL_EMAIL 3
+#define GG_USERUTIL_PASS 0
+#define GG_USERUTIL_CREATE 1
+#define GG_USERUTIL_REMOVE 2
+#define GG_USERUTIL_EMAIL 3
// popup flags
-#define GG_POPUP_ALLOW_MSGBOX 1
-#define GG_POPUP_ONCE 2
-#define GG_POPUP_ERROR 4
-#define GG_POPUP_WARNING 8
-#define GG_POPUP_MULTILOGON 16
+#define GG_POPUP_ALLOW_MSGBOX 1
+#define GG_POPUP_ONCE 2
+#define GG_POPUP_ERROR 4
+#define GG_POPUP_WARNING 8
+#define GG_POPUP_MULTILOGON 16
// Some MSVC compatibility with gcc
#ifndef strcasecmp
diff --git a/protocols/Gadu-Gadu/src/options.cpp b/protocols/Gadu-Gadu/src/options.cpp
index 76896dd06a..fcbb84e31d 100644
--- a/protocols/Gadu-Gadu/src/options.cpp
+++ b/protocols/Gadu-Gadu/src/options.cpp
@@ -208,7 +208,7 @@ static INT_PTR CALLBACK gg_genoptsdlgproc(HWND m_hwnd, UINT msg, WPARAM wParam,
gg->delSetting(GG_KEY_PD_FAMILYCITY);
gg->delSetting(GG_KEY_PD_AGE);
gg->delSetting(GG_KEY_PD_BIRTHYEAR);
- gg->delSetting(GG_KEY_PD_GANDER);
+ gg->delSetting(GG_KEY_PD_GENDER);
}
}
}
diff --git a/protocols/Gadu-Gadu/src/userinfo.cpp b/protocols/Gadu-Gadu/src/userinfo.cpp
index 66c63d13d9..92c031e12b 100644
--- a/protocols/Gadu-Gadu/src/userinfo.cpp
+++ b/protocols/Gadu-Gadu/src/userinfo.cpp
@@ -202,10 +202,10 @@ public:
SetValue(IDC_CITYORIGIN, szProto, GG_KEY_PD_FAMILYCITY, SVS_NORMAL);
if (m_hContact) {
- SetValue(IDC_GENDER, szProto, GG_KEY_PD_GANDER, SVS_GENDER);
+ SetValue(IDC_GENDER, szProto, GG_KEY_PD_GENDER, SVS_GENDER);
SetValue(IDC_STATUSDESCR, "CList", GG_KEY_STATUSDESCR, SVS_NORMAL);
}
- else switch ((char)db_get_b(m_hContact, gg->m_szModuleName, GG_KEY_PD_GANDER, (uint8_t)'?')) {
+ else switch ((char)db_get_b(m_hContact, gg->m_szModuleName, GG_KEY_PD_GENDER, (uint8_t)'?')) {
case 'F':
SendDlgItemMessage(m_hwnd, IDC_GENDER, CB_SETCURSEL, 1, 0);
break;
diff --git a/protocols/Gadu-Gadu/src/version.h b/protocols/Gadu-Gadu/src/version.h
index 724a2e2a06..dbe6766c55 100644
--- a/protocols/Gadu-Gadu/src/version.h
+++ b/protocols/Gadu-Gadu/src/version.h
@@ -19,8 +19,8 @@
////////////////////////////////////////////////////////////////////////////////
#define __MAJOR_VERSION 0
-#define __MINOR_VERSION 95
-#define __RELEASE_NUM 11
+#define __MINOR_VERSION 96
+#define __RELEASE_NUM 3
#define __BUILD_NUM 1
#include <stdver.h>