diff options
author | George Hazan <ghazan@miranda.im> | 2021-01-26 21:20:26 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-01-26 21:20:26 +0300 |
commit | 21b040b1f73ccb5c5d89c0085bcffc8fdde1efd1 (patch) | |
tree | cf9d988f5a7bfd7acf2525ea2d7277b6e0dac9db /protocols/SkypeWeb/src | |
parent | 555c7f83e3552a6210bc96e70b2aaecd14732e7a (diff) |
SKYPE_1.UseServerTime BYTE = 0 - hidden setting to use server-side timestamp always in histories
Diffstat (limited to 'protocols/SkypeWeb/src')
-rw-r--r-- | protocols/SkypeWeb/src/skype_contacts.cpp | 12 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_db.h | 28 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_history_sync.cpp | 2 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_login.cpp | 6 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_options.cpp | 14 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_proto.cpp | 10 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_proto.h | 21 |
7 files changed, 43 insertions, 50 deletions
diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp index 1001e25e7f..c7e225451d 100644 --- a/protocols/SkypeWeb/src/skype_contacts.cpp +++ b/protocols/SkypeWeb/src/skype_contacts.cpp @@ -87,9 +87,9 @@ MCONTACT CSkypeProto::AddContact(const char *skypeId, bool isTemporary) setString(hContact, SKYPE_SETTINGS_ID, skypeId);
setUString(hContact, "Nick", GetSkypeNick(skypeId));
- if (m_opts.wstrCListGroup) {
- Clist_GroupCreate(0, m_opts.wstrCListGroup);
- Clist_SetGroup(hContact, m_opts.wstrCListGroup);
+ if (wstrCListGroup) {
+ Clist_GroupCreate(0, wstrCListGroup);
+ Clist_SetGroup(hContact, wstrCListGroup);
}
setByte(hContact, "Auth", 1);
@@ -177,9 +177,9 @@ void CSkypeProto::LoadContactList(NETLIBHTTPREQUEST *response, AsyncHttpRequest* ptrW wszGroup(Clist_GetGroup(hContact));
if (wszGroup == nullptr) {
- if (m_opts.wstrCListGroup) {
- Clist_GroupCreate(0, m_opts.wstrCListGroup);
- Clist_SetGroup(hContact, m_opts.wstrCListGroup);
+ if (wstrCListGroup) {
+ Clist_GroupCreate(0, wstrCListGroup);
+ Clist_SetGroup(hContact, wstrCListGroup);
}
}
diff --git a/protocols/SkypeWeb/src/skype_db.h b/protocols/SkypeWeb/src/skype_db.h index 3bd9242ca4..76b228675d 100644 --- a/protocols/SkypeWeb/src/skype_db.h +++ b/protocols/SkypeWeb/src/skype_db.h @@ -37,32 +37,4 @@ enum SKYPE_DB_EVENT_TYPE #define SKYPE_SETTINGS_PASSWORD "Password"
#define SKYPE_SETTINGS_GROUP "DefaultGroup"
-struct CSkypeOptions
-{
- CMOption<BYTE> bAutoHistorySync;
- CMOption<BYTE> bMarkAllAsUnread;
-
- CMOption<BYTE> bUseHostnameAsPlace;
- CMOption<wchar_t*> wstrPlace;
-
- CMOption<BYTE> bUseBBCodes;
-
- CMOption<wchar_t*> wstrCListGroup;
-
- CSkypeOptions(PROTO_INTERFACE *proto) :
-
- bAutoHistorySync(proto, "AutoSync", true),
- bMarkAllAsUnread(proto, "MarkMesUnread", true),
-
- wstrPlace(proto, "Place", L""),
- bUseHostnameAsPlace(proto, "UseHostName", true),
-
- bUseBBCodes(proto, "UseBBCodes", true),
-
- wstrCListGroup(proto, SKYPE_SETTINGS_GROUP, L"Skype")
- {
- }
-
-};
-
#endif //_SKYPE_DB_H_
\ No newline at end of file diff --git a/protocols/SkypeWeb/src/skype_history_sync.cpp b/protocols/SkypeWeb/src/skype_history_sync.cpp index 11af13caa7..550cb7fb69 100644 --- a/protocols/SkypeWeb/src/skype_history_sync.cpp +++ b/protocols/SkypeWeb/src/skype_history_sync.cpp @@ -33,7 +33,7 @@ void CSkypeProto::OnGetServerHistory(NETLIBHTTPREQUEST *response, AsyncHttpReque std::string syncState = metadata["syncState"].as_string();
bool markAllAsUnread = getBool("MarkMesUnread", true);
- bool bUseLocalTime = pRequest->pUserInfo != 0;
+ bool bUseLocalTime = !bUseServerTime && pRequest->pUserInfo != 0;
time_t iLocalTime = time(0);
if (totalCount >= 99 || conversations.size() >= 99)
diff --git a/protocols/SkypeWeb/src/skype_login.cpp b/protocols/SkypeWeb/src/skype_login.cpp index f591cfe710..18dac054e9 100644 --- a/protocols/SkypeWeb/src/skype_login.cpp +++ b/protocols/SkypeWeb/src/skype_login.cpp @@ -206,8 +206,8 @@ void CSkypeProto::SendPresence() {
ptrA epname;
- if (!m_opts.bUseHostnameAsPlace && m_opts.wstrPlace && *m_opts.wstrPlace)
- epname = mir_utf8encodeW(m_opts.wstrPlace);
+ if (!bUseHostnameAsPlace && wstrPlace && *wstrPlace)
+ epname = mir_utf8encodeW(wstrPlace);
else {
wchar_t compName[MAX_COMPUTERNAME_LENGTH + 1];
DWORD size = _countof(compName);
@@ -246,7 +246,7 @@ void CSkypeProto::OnCapabilitiesSended(NETLIBHTTPREQUEST *response, AsyncHttpReq PushRequest(new GetContactListRequest(this, nullptr));
PushRequest(new GetAvatarRequest(ptrA(getStringA("AvatarUrl")), 0));
- if (m_opts.bAutoHistorySync)
+ if (bAutoHistorySync)
PushRequest(new SyncHistoryFirstRequest(100));
JSONNode root = JSONNode::parse(response->pData);
diff --git a/protocols/SkypeWeb/src/skype_options.cpp b/protocols/SkypeWeb/src/skype_options.cpp index 8ba4b2f50a..0a65b87f8e 100644 --- a/protocols/SkypeWeb/src/skype_options.cpp +++ b/protocols/SkypeWeb/src/skype_options.cpp @@ -36,12 +36,12 @@ public: m_usebb(this, IDC_BBCODES),
m_link(this, IDC_CHANGEPASS, "https://login.skype.com/recovery/password-change") // TODO : ...?username=%username%
{
- CreateLink(m_group, proto->m_opts.wstrCListGroup);
- CreateLink(m_autosync, proto->m_opts.bAutoHistorySync);
- CreateLink(m_allasunread, proto->m_opts.bMarkAllAsUnread);
- CreateLink(m_place, proto->m_opts.wstrPlace);
- CreateLink(m_usehostname, proto->m_opts.bUseHostnameAsPlace);
- CreateLink(m_usebb, proto->m_opts.bUseBBCodes);
+ CreateLink(m_group, proto->wstrCListGroup);
+ CreateLink(m_autosync, proto->bAutoHistorySync);
+ CreateLink(m_allasunread, proto->bMarkAllAsUnread);
+ CreateLink(m_place, proto->wstrPlace);
+ CreateLink(m_usehostname, proto->bUseHostnameAsPlace);
+ CreateLink(m_usebb, proto->bUseBBCodes);
m_usehostname.OnChange = Callback(this, &CSkypeOptionsMain::OnUsehostnameCheck);
}
@@ -51,7 +51,7 @@ public: m_skypename.SetTextA(ptrA(m_proto->getStringA(SKYPE_SETTINGS_ID)));
m_password.SetTextA(pass_ptrA(m_proto->getStringA("Password")));
- m_place.Enable(!m_proto->m_opts.bUseHostnameAsPlace);
+ m_place.Enable(!m_proto->bUseHostnameAsPlace);
m_skypename.SendMsg(EM_LIMITTEXT, 128, 0);
m_password.SendMsg(EM_LIMITTEXT, 128, 0);
m_group.SendMsg(EM_LIMITTEXT, 64, 0);
diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp index d9e5dc46db..a8f8e15cfb 100644 --- a/protocols/SkypeWeb/src/skype_proto.cpp +++ b/protocols/SkypeWeb/src/skype_proto.cpp @@ -22,9 +22,15 @@ CSkypeProto::CSkypeProto(const char* protoName, const wchar_t* userName) : m_PopupClasses(1), m_OutMessages(3, PtrKeySortT), m_bThreadsTerminated(false), - m_opts(this), m_impl(*this), - m_requests(1) + m_requests(1), + bAutoHistorySync(this, "AutoSync", true), + bMarkAllAsUnread(this, "MarkMesUnread", true), + bUseHostnameAsPlace(this, "UseHostName", true), + bUseBBCodes(this, "UseBBCodes", true), + bUseServerTime(this, "UseServerTime", false), + wstrCListGroup(this, SKYPE_SETTINGS_GROUP, L"Skype"), + wstrPlace(this, "Place", L"") { NETLIBUSER nlu = {}; CMStringW name(FORMAT, TranslateT("%s connection"), m_tszUserName); diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h index 35018336f4..99a18ac1b1 100644 --- a/protocols/SkypeWeb/src/skype_proto.h +++ b/protocols/SkypeWeb/src/skype_proto.h @@ -92,11 +92,27 @@ public: // search
void __cdecl SearchBasicThread(void* id);
- ////////////////////////////////////////////
+ //////////////////////////////////////////////////////////////////////////////////////
+ // services
+
static INT_PTR EventGetIcon(WPARAM wParam, LPARAM lParam);
static INT_PTR GetEventText(WPARAM, LPARAM lParam);
- CSkypeOptions m_opts;
+ //////////////////////////////////////////////////////////////////////////////////////
+ // settings
+
+ CMOption<bool> bAutoHistorySync;
+ CMOption<bool> bMarkAllAsUnread;
+ CMOption<bool> bUseBBCodes;
+ CMOption<bool> bUseServerTime; // hidden setting!
+
+ CMOption<bool> bUseHostnameAsPlace;
+ CMOption<wchar_t*> wstrPlace;
+
+ CMOption<wchar_t*> wstrCListGroup;
+
+ //////////////////////////////////////////////////////////////////////////////////////
+ // other data
int m_iPollingId;
ptrA m_szApiToken, m_szToken, m_szId;
@@ -187,7 +203,6 @@ private: EventHandle m_hRequestQueueEvent;
HANDLE m_hRequestQueueThread;
- static unsigned __cdecl AsyncSendThread(void *, void *);
void __cdecl WorkerThread(void *);
void StartQueue();
|