diff options
author | George Hazan <george.hazan@gmail.com> | 2024-09-22 18:11:42 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-09-22 18:11:42 +0300 |
commit | f7ec875eee3960f5883448d536b10c2830f15057 (patch) | |
tree | 63b958d661896f42a4e08e43d41877a8c5c2c989 /protocols | |
parent | f046b1e4f64b22acd88787e56f6ca41ec7954af2 (diff) |
code cleaning
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/SkypeWeb/src/skype_contacts.cpp | 12 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_history_sync.cpp | 4 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_login.cpp | 4 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_mood.cpp | 40 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_options.cpp | 12 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_proto.cpp | 18 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_proto.h | 16 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_utils.cpp | 6 |
8 files changed, 56 insertions, 56 deletions
diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp index 1e8bcfb3ed..e1264b1781 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, const char *nick, bool isT setString(hContact, SKYPE_SETTINGS_ID, skypeId);
setUString(hContact, "Nick", (nick) ? nick : GetSkypeNick(skypeId));
- if (wstrCListGroup) {
- Clist_GroupCreate(0, wstrCListGroup);
- Clist_SetGroup(hContact, wstrCListGroup);
+ if (m_wstrCListGroup) {
+ Clist_GroupCreate(0, m_wstrCListGroup);
+ Clist_SetGroup(hContact, m_wstrCListGroup);
}
setByte(hContact, "Auth", 1);
@@ -178,9 +178,9 @@ void CSkypeProto::LoadContactList(MHttpResponse *response, AsyncHttpRequest*) delSetting(hContact, "IsBlocked");
ptrW wszGroup(Clist_GetGroup(hContact));
- if (wszGroup == nullptr && wstrCListGroup) {
- Clist_GroupCreate(0, wstrCListGroup);
- Clist_SetGroup(hContact, wstrCListGroup);
+ if (wszGroup == nullptr && m_wstrCListGroup) {
+ Clist_GroupCreate(0, m_wstrCListGroup);
+ Clist_SetGroup(hContact, m_wstrCListGroup);
}
auto &profile = item["profile"];
diff --git a/protocols/SkypeWeb/src/skype_history_sync.cpp b/protocols/SkypeWeb/src/skype_history_sync.cpp index 99a1cb6c17..03281a60eb 100644 --- a/protocols/SkypeWeb/src/skype_history_sync.cpp +++ b/protocols/SkypeWeb/src/skype_history_sync.cpp @@ -33,7 +33,7 @@ void CSkypeProto::OnGetServerHistory(MHttpResponse *response, AsyncHttpRequest * std::string syncState = metadata["syncState"].as_string();
bool bOperative = pRequest->pUserInfo != 0;
- bool bUseLocalTime = !bUseServerTime && bOperative;
+ bool bUseLocalTime = !m_bUseServerTime && bOperative;
bool bSetLastTime = false;
int64_t lastMsgTime = 0; // max timestamp on this page
@@ -132,7 +132,7 @@ void CSkypeProto::OnSyncConversations(MHttpResponse *response, AsyncHttpRequest* MCONTACT hContact = FindContact(szSkypename);
if (hContact != NULL) {
auto lastMsgTime = getLastTime(hContact);
- if (lastMsgTime && lastMsgTime < id && bAutoHistorySync)
+ if (lastMsgTime && lastMsgTime < id && m_bAutoHistorySync)
PushRequest(new GetHistoryRequest(hContact, szSkypename, 100, lastMsgTime, false));
}
}
diff --git a/protocols/SkypeWeb/src/skype_login.cpp b/protocols/SkypeWeb/src/skype_login.cpp index 9c13f39804..951952e8ce 100644 --- a/protocols/SkypeWeb/src/skype_login.cpp +++ b/protocols/SkypeWeb/src/skype_login.cpp @@ -246,8 +246,8 @@ void CSkypeProto::SendPresence() {
ptrA epname;
- if (!bUseHostnameAsPlace && wstrPlace && *wstrPlace)
- epname = mir_utf8encodeW(wstrPlace);
+ if (!m_bUseHostnameAsPlace && m_wstrPlace && *m_wstrPlace)
+ epname = mir_utf8encodeW(m_wstrPlace);
else {
wchar_t compName[MAX_COMPUTERNAME_LENGTH + 1];
DWORD size = _countof(compName);
diff --git a/protocols/SkypeWeb/src/skype_mood.cpp b/protocols/SkypeWeb/src/skype_mood.cpp index 78ceebec8a..dfaa5b0922 100644 --- a/protocols/SkypeWeb/src/skype_mood.cpp +++ b/protocols/SkypeWeb/src/skype_mood.cpp @@ -44,31 +44,31 @@ struct SetStatusMsgRequest : public AsyncHttpRequest SetStatusMsgRequest(CSkypeProto *ppro) : AsyncHttpRequest(REQUEST_POST, HOST_API, "/users/self/profile/partial") { - int iMood = ppro->iMood; - auto &pMood = moods[iMood]; + int m_iMood = ppro->m_iMood; + auto &pMood = moods[m_iMood]; JSONNode node, payload; payload.set_name("payload"); CMStringW s1, s2; - switch (iMood) { + switch (m_iMood) { case 0: // none - s1 = ppro->wstrMoodMessage; + s1 = ppro->m_wstrMoodMessage; break; case 1: // custom - s1.Format(L"(%x) %s", Utf16toUtf32(ppro->wstrMoodEmoji), (wchar_t *)ppro->wstrMoodMessage); + s1.Format(L"(%x) %s", Utf16toUtf32(ppro->m_wstrMoodEmoji), (wchar_t *)ppro->m_wstrMoodMessage); break; default: - s1.Format(L"(%S) %s", pMood.ss, (wchar_t *)ppro->wstrMoodMessage); + s1.Format(L"(%S) %s", pMood.ss, (wchar_t *)ppro->m_wstrMoodMessage); break; } payload << WCHAR_PARAM("mood", s1); - if (iMood > 1) - s2.Format(L"<ss type=\"%S\">(%S)</ss>%s", pMood.ss, pMood.ss, (wchar_t*)ppro->wstrMoodMessage); - else if (iMood == 1) { - int code = Utf16toUtf32(ppro->wstrMoodEmoji); - s2.Format(L"<ss type=\"%x\">(%x)</ss>%s", code, code, (wchar_t *)ppro->wstrMoodMessage); + if (m_iMood > 1) + s2.Format(L"<ss type=\"%S\">(%S)</ss>%s", pMood.ss, pMood.ss, (wchar_t*)ppro->m_wstrMoodMessage); + else if (m_iMood == 1) { + int code = Utf16toUtf32(ppro->m_wstrMoodEmoji); + s2.Format(L"<ss type=\"%x\">(%x)</ss>%s", code, code, (wchar_t *)ppro->m_wstrMoodMessage); } if (!s2.IsEmpty()) @@ -103,8 +103,8 @@ public: edtEmoji(this, IDC_MOOD_EMOJI), cmbMoods(this, IDC_MOOD_COMBO) { - CreateLink(edtText, ppro->wstrMoodMessage); - CreateLink(edtEmoji, ppro->wstrMoodEmoji); + CreateLink(edtText, ppro->m_wstrMoodMessage); + CreateLink(edtEmoji, ppro->m_wstrMoodEmoji); cmbMoods.OnChange = Callback(this, &CMoodDialog::onChangeSel_Mood); } @@ -113,17 +113,17 @@ public: { for (auto &it : moods) cmbMoods.AddString(TranslateW(it.defStatus), int(&it - moods)); - cmbMoods.SetCurSel(m_proto->iMood); + cmbMoods.SetCurSel(m_proto->m_iMood); onChangeSel_Mood(0); return true; } bool OnApply() override { - m_proto->iMood = cmbMoods.GetCurSel(); + m_proto->m_iMood = cmbMoods.GetCurSel(); - CMStringA szSetting(FORMAT, "Mood%d", (int)m_proto->iMood); - m_proto->setWString(szSetting, m_proto->wstrMoodMessage); + CMStringA szSetting(FORMAT, "Mood%d", (int)m_proto->m_iMood); + m_proto->setWString(szSetting, m_proto->m_wstrMoodMessage); m_proto->PushRequest(new SetStatusMsgRequest(m_proto)); return true; @@ -131,10 +131,10 @@ public: void onChangeSel_Mood(CCtrlCombo *) { - int iMood = cmbMoods.GetCurSel(); - edtEmoji.Enable(iMood == 1); + int m_iMood = cmbMoods.GetCurSel(); + edtEmoji.Enable(m_iMood == 1); - CMStringA szSetting(FORMAT, "Mood%d", iMood); + CMStringA szSetting(FORMAT, "Mood%d", m_iMood); edtText.SetText(m_proto->getMStringW(szSetting)); } }; diff --git a/protocols/SkypeWeb/src/skype_options.cpp b/protocols/SkypeWeb/src/skype_options.cpp index f5d3f5dee5..08bd45942f 100644 --- a/protocols/SkypeWeb/src/skype_options.cpp +++ b/protocols/SkypeWeb/src/skype_options.cpp @@ -35,11 +35,11 @@ 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->wstrCListGroup);
- CreateLink(m_autosync, proto->bAutoHistorySync);
- CreateLink(m_place, proto->wstrPlace);
- CreateLink(m_usehostname, proto->bUseHostnameAsPlace);
- CreateLink(m_usebb, proto->bUseBBCodes);
+ CreateLink(m_group, proto->m_wstrCListGroup);
+ CreateLink(m_autosync, proto->m_bAutoHistorySync);
+ CreateLink(m_place, proto->m_wstrPlace);
+ CreateLink(m_usehostname, proto->m_bUseHostnameAsPlace);
+ CreateLink(m_usebb, proto->m_bUseBBCodes);
m_usehostname.OnChange = Callback(this, &CSkypeOptionsMain::OnUsehostnameCheck);
}
@@ -47,7 +47,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->bUseHostnameAsPlace);
+ m_place.Enable(!m_proto->m_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 2bdde69b10..eb7cbc46c9 100644 --- a/protocols/SkypeWeb/src/skype_proto.cpp +++ b/protocols/SkypeWeb/src/skype_proto.cpp @@ -23,15 +23,15 @@ CSkypeProto::CSkypeProto(const char *protoName, const wchar_t *userName) : m_OutMessages(3, PtrKeySortT),
m_impl(*this),
m_requests(1),
- bAutoHistorySync(this, "AutoSync", true),
- bUseHostnameAsPlace(this, "UseHostName", true),
- bUseBBCodes(this, "UseBBCodes", true),
- bUseServerTime(this, "UseServerTime", false),
- wstrCListGroup(this, SKYPE_SETTINGS_GROUP, L"Skype"),
- wstrPlace(this, "Place", L""),
- iMood(this, "Mood", 0),
- wstrMoodEmoji(this, "MoodEmoji", L""),
- wstrMoodMessage(this, "XStatusMsg", L"")
+ m_bAutoHistorySync(this, "AutoSync", true),
+ m_bUseHostnameAsPlace(this, "UseHostName", true),
+ m_bUseBBCodes(this, "UseBBCodes", true),
+ m_bUseServerTime(this, "UseServerTime", false),
+ m_wstrCListGroup(this, SKYPE_SETTINGS_GROUP, L"Skype"),
+ m_wstrPlace(this, "Place", L""),
+ m_iMood(this, "Mood", 0),
+ m_wstrMoodEmoji(this, "MoodEmoji", L""),
+ m_wstrMoodMessage(this, "XStatusMsg", L"")
{
NETLIBUSER nlu = {};
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_UNICODE;
diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h index 2b8b7e5e8c..70f4bada85 100644 --- a/protocols/SkypeWeb/src/skype_proto.h +++ b/protocols/SkypeWeb/src/skype_proto.h @@ -106,17 +106,17 @@ public: //////////////////////////////////////////////////////////////////////////////////////
// settings
- CMOption<bool> bAutoHistorySync;
- CMOption<bool> bUseBBCodes;
- CMOption<bool> bUseServerTime; // hidden setting!
+ CMOption<bool> m_bAutoHistorySync;
+ CMOption<bool> m_bUseBBCodes;
+ CMOption<bool> m_bUseServerTime; // hidden setting!
- CMOption<bool> bUseHostnameAsPlace;
- CMOption<wchar_t*> wstrPlace;
+ CMOption<bool> m_bUseHostnameAsPlace;
+ CMOption<wchar_t*> m_wstrPlace;
- CMOption<wchar_t*> wstrCListGroup;
+ CMOption<wchar_t*> m_wstrCListGroup;
- CMOption<uint8_t> iMood;
- CMOption<wchar_t*> wstrMoodMessage, wstrMoodEmoji;
+ CMOption<uint8_t> m_iMood;
+ CMOption<wchar_t*> m_wstrMoodMessage, m_wstrMoodEmoji;
//////////////////////////////////////////////////////////////////////////////////////
// other data
diff --git a/protocols/SkypeWeb/src/skype_utils.cpp b/protocols/SkypeWeb/src/skype_utils.cpp index c0df20805c..9d37275a69 100644 --- a/protocols/SkypeWeb/src/skype_utils.cpp +++ b/protocols/SkypeWeb/src/skype_utils.cpp @@ -357,7 +357,7 @@ CMStringW CSkypeProto::RemoveHtml(const CMStringW &data, bool bCheckSS) else if (!wcsncmp(data.c_str() + i + 1, L"/ss>", 4)) {
CMStringW wszStatusMsg = data.Mid(i + 5);
wszStatusMsg.Trim();
- wstrMoodMessage = wszStatusMsg;
+ m_wstrMoodMessage = wszStatusMsg;
inSS = false;
}
@@ -439,10 +439,10 @@ CMStringW CSkypeProto::RemoveHtml(const CMStringW &data, bool bCheckSS) CMStringW ss(data.Mid(i + 1, iEnd - i - 1));
uint32_t code = getMoodIndex(T2Utf(ss));
if (code != -1)
- iMood = code;
+ m_iMood = code;
else if (1 == swscanf(ss, L"%x_", &code)) {
Utf32toUtf16(code, new_string);
- wstrMoodEmoji = new_string;
+ m_wstrMoodEmoji = new_string;
}
i = iEnd;
|