From 3d805c9681df6ed8fd6fb1e6eef7572d554bed66 Mon Sep 17 00:00:00 2001 From: Sergey Bolhovskoy Date: Tue, 30 Dec 2014 08:55:18 +0000 Subject: VKontakte: cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@11678 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/misc.cpp | 14 ++-- protocols/VKontakte/src/vk.h | 30 ++++---- protocols/VKontakte/src/vk_avatars.cpp | 2 +- protocols/VKontakte/src/vk_chats.cpp | 6 +- protocols/VKontakte/src/vk_feed.cpp | 46 ++++++------- protocols/VKontakte/src/vk_files.cpp | 2 +- protocols/VKontakte/src/vk_options.cpp | 12 ++-- protocols/VKontakte/src/vk_proto.cpp | 6 +- protocols/VKontakte/src/vk_proto.h | 122 ++++++++++++++++----------------- protocols/VKontakte/src/vk_thread.cpp | 12 ++-- 10 files changed, 126 insertions(+), 126 deletions(-) (limited to 'protocols') diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index 05d2574408..4bf8dfaf83 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -409,7 +409,7 @@ void CVkProto::GrabCookies(NETLIBHTTPREQUEST *nhr) if (bFirstToken) { int iStart2 = 0; szCookieName = szToken.Tokenize("=", iStart2); - szCookieVal = szToken.Tokenize("=", iStart2); + szCookieVal = szToken.Tokenize("=", iStart2); } else if (!strncmp(szToken, "domain=", 7)) szDomain = szToken.Mid(7); @@ -472,7 +472,7 @@ void CVkProto::DBAddAuthRequest(const MCONTACT hContact) *((PDWORD)pCurBlob) = 0; pCurBlob += sizeof(DWORD); // uin(DWORD) = 0 (DWORD) - *((PDWORD)pCurBlob) = (DWORD)hContact; + *((PDWORD)pCurBlob) = (DWORD)hContact; pCurBlob += sizeof(DWORD); // hContact(DWORD) strcpy((char*)pCurBlob, szNick); @@ -635,7 +635,7 @@ char* CVkProto::GetStickerId(const char* Msg, int &stickerid) return NULL; } -int CVkProto::OnDbSettingChanged(WPARAM hContact, LPARAM lParam) +int CVkProto::OnDbSettingChanged(WPARAM hContact, LPARAM lParam) { DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam; if (hContact != NULL) @@ -723,7 +723,7 @@ CMString CVkProto::GetVkPhotoItem(JSONNODE *pPhoto) } } - switch (m_iIMGBBCSupport){ + switch (m_iIMGBBCSupport) { case imgNo: ptszPreviewLink = NULL; break; @@ -777,7 +777,7 @@ CMString CVkProto::SetBBCString(TCHAR *tszString, VKBBCType bbcType, TCHAR *tszA TCHAR *ptszFormat = NULL; for (int i = 0; i < SIZEOF(bbcItem); i++) - if (bbcItem[i].vkBBCType == bbcType && bbcItem[i].vkBBCSettings == m_iBBCForNews){ + if (bbcItem[i].vkBBCType == bbcType && bbcItem[i].vkBBCSettings == m_iBBCForNews) { ptszFormat = bbcItem[i].ptszTempate; break; } @@ -799,7 +799,7 @@ CMString CVkProto::SetBBCString(TCHAR *tszString, VKBBCType bbcType, TCHAR *tszA CMString& CVkProto::ClearFormatNick(CMString& tszText) { int iNameEnd = tszText.Find(_T("],")), iNameBeg = tszText.Find(_T("|")); - if (iNameEnd != -1 && iNameBeg != -1 && iNameBeg < iNameEnd){ + if (iNameEnd != -1 && iNameBeg != -1 && iNameBeg < iNameEnd) { CMString tszName = tszText.Mid(iNameBeg + 1, iNameEnd - iNameBeg - 1); CMString tszBody = tszText.Mid(iNameEnd + 2); if (!tszName.IsEmpty() && !tszBody.IsEmpty()) @@ -894,7 +894,7 @@ CMString CVkProto::GetAttachmentDescr(JSONNODE *pAttachments) res.AppendFormat(_T("[img]%s[/img]"), ptszLink); } } - else if (!mir_tstrcmp(ptszType, _T("link"))){ + else if (!mir_tstrcmp(ptszType, _T("link"))) { JSONNODE *pLink = json_get(pAttach, "link"); if (pLink == NULL) continue; diff --git a/protocols/VKontakte/src/vk.h b/protocols/VKontakte/src/vk.h index 296fcc3b19..45ce6daf0c 100644 --- a/protocols/VKontakte/src/vk.h +++ b/protocols/VKontakte/src/vk.h @@ -15,22 +15,22 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#define VK_APP_ID 3917910 +#define VK_APP_ID 3917910 // LongPool servers events -#define VKPOLL_MSG_REMOVED 0 -#define VKPOLL_MSG_NEWFLAGS 1 -#define VKPOLL_MSG_ADDFLAGS 2 -#define VKPOLL_MSG_DELFLAGS 3 -#define VKPOLL_MSG_ADDED 4 -#define VKPOLL_READ_ALL_IN 6 -#define VKPOLL_READ_ALL_OUT 7 -#define VKPOLL_USR_ONLINE 8 -#define VKPOLL_USR_OFFLINE 9 -#define VKPOLL_CHAT_CHANGED 51 -#define VKPOLL_USR_UTN 61 -#define VKPOLL_CHAT_UTN 62 -#define VKPOLL_RING 70 +#define VKPOLL_MSG_REMOVED 0 +#define VKPOLL_MSG_NEWFLAGS 1 +#define VKPOLL_MSG_ADDFLAGS 2 +#define VKPOLL_MSG_DELFLAGS 3 +#define VKPOLL_MSG_ADDED 4 +#define VKPOLL_READ_ALL_IN 6 +#define VKPOLL_READ_ALL_OUT 7 +#define VKPOLL_USR_ONLINE 8 +#define VKPOLL_USR_OFFLINE 9 +#define VKPOLL_CHAT_CHANGED 51 +#define VKPOLL_USR_UTN 61 +#define VKPOLL_CHAT_UTN 62 +#define VKPOLL_RING 70 // Flags for VKPOLL_MSG_ADDED #define VKFLAG_MSGUNREAD 1 // сообщение не прочитано @@ -52,7 +52,7 @@ along with this program. If not, see . #define VKERR_FLOOD_CONTROL 9 // Flood control #define VKERR_INTERNAL_SERVER_ERR 10 // Internal server error #define VKERR_CAPTCHA_NEEDED 14 // Captcha needed -#define VKERR_ACCESS_DENIED 15 // Access denied +#define VKERR_ACCESS_DENIED 15 // Access denied #define VKERR_COULD_NOT_SAVE_FILE 105 // Couldn't save file #define VKERR_INVALID_ALBUM_ID 114 // Invalid album id #define VKERR_INVALID_SERVER 118 // Invalid server diff --git a/protocols/VKontakte/src/vk_avatars.cpp b/protocols/VKontakte/src/vk_avatars.cpp index 51b8538a1c..0c680266c7 100644 --- a/protocols/VKontakte/src/vk_avatars.cpp +++ b/protocols/VKontakte/src/vk_avatars.cpp @@ -115,7 +115,7 @@ INT_PTR CVkProto::SvcGetMyAvatar(WPARAM wParam, LPARAM lParam) return 1; TCHAR* buf = (TCHAR*)wParam; - int size = (int)lParam; + int size = (int)lParam; _tcsncpy(buf, AI.filename, size); buf[size - 1] = 0; diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp index cfeb76894f..d467707bfc 100644 --- a/protocols/VKontakte/src/vk_chats.cpp +++ b/protocols/VKontakte/src/vk_chats.cpp @@ -77,7 +77,7 @@ CVkChatInfo* CVkProto::AppendChat(int id, JSONNODE *pDlg) } setDword(gci.hContact, "vk_chat_id", id); - db_unset(gci.hContact, m_szModuleName, "off"); + db_unset(gci.hContact, m_szModuleName, "off"); if (json_as_int(json_get(pDlg, "left")) == 1) { setByte(gci.hContact, "off", 1); @@ -362,7 +362,7 @@ int CVkProto::OnChatEvent(WPARAM, LPARAM lParam) TCHAR *buf = NEWTSTR_ALLOCA(gch->ptszText); rtrimt(buf); UnEscapeChatTags(buf); - AsyncHttpRequest *pReq = new AsyncHttpRequest(this, REQUEST_POST, "/method/messages.send.json", true, &CVkProto::OnSendChatMsg) + AsyncHttpRequest *pReq = new AsyncHttpRequest(this, REQUEST_POST, "/method/messages.send.json", true, &CVkProto::OnSendChatMsg) << INT_PARAM("chat_id", cc->m_chatid) << CHAR_PARAM("message", mir_utf8encodeT(buf)) << VER_API; @@ -734,7 +734,7 @@ static INT_PTR CALLBACK GcCreateDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L { HWND hwndClist = GetDlgItem(hwndDlg, IDC_CLIST); SetWindowLongPtr(hwndClist, GWL_STYLE, - GetWindowLongPtr(hwndClist, GWL_STYLE) | CLS_CHECKBOXES | CLS_HIDEEMPTYGROUPS | CLS_USEGROUPS | CLS_GREYALTERNATE | CLS_GROUPCHECKBOXES); + GetWindowLongPtr(hwndClist, GWL_STYLE) | CLS_CHECKBOXES | CLS_HIDEEMPTYGROUPS | CLS_USEGROUPS | CLS_GREYALTERNATE | CLS_GROUPCHECKBOXES); SendMessage(hwndClist, CLM_SETEXSTYLE, CLS_EX_DISABLEDRAGDROP | CLS_EX_TRACKSELECT, 0); ResetOptions(hwndDlg); diff --git a/protocols/VKontakte/src/vk_feed.cpp b/protocols/VKontakte/src/vk_feed.cpp index 918bbd2618..40e8f34106 100644 --- a/protocols/VKontakte/src/vk_feed.cpp +++ b/protocols/VKontakte/src/vk_feed.cpp @@ -33,7 +33,7 @@ void CVkProto::AddFeedSpecialUser() CMString tszNick = TranslateT("VKontakte"); setTString(hContact, "Nick", tszNick.GetBuffer()); - CMString tszUrl = _T("https://vk.com/press/Simple.png"); + CMString tszUrl = _T("https://vk.com/press/Simple.png"); SetAvatarUrl(hContact, tszUrl); ReloadAvatarInfo(hContact); @@ -82,7 +82,7 @@ CVkUserInfo* CVkProto::GetVkUserInfo(LONG iUserId, OBJLIST &vkUsers if (vkUser == NULL) { CMString tszNick = TranslateT("Unknown"); CMString tszLink = _T("https://vk.com/"); - if (iUserId){ + if (iUserId) { tszLink += bIsGroup ? "club" : "id"; tszLink.AppendFormat(_T("%d"), bIsGroup ? -iUserId : iUserId); } @@ -102,7 +102,7 @@ void CVkProto::CreateVkUserInfoList(OBJLIST &vkUsers, JSONNODE *pRe JSONNODE *pProfiles = json_get(pResponse, "profiles"); JSONNODE *pProfile; if (pProfiles != NULL) - for (size_t i = 0; (pProfile = json_at(pProfiles, i)) != NULL; i++){ + for (size_t i = 0; (pProfile = json_at(pProfiles, i)) != NULL; i++) { LONG UserId = json_as_int(json_get(pProfile, "id")); if (!UserId) continue; @@ -118,7 +118,7 @@ void CVkProto::CreateVkUserInfoList(OBJLIST &vkUsers, JSONNODE *pRe JSONNODE *pGroups = json_get(pResponse, "groups"); if (pGroups != NULL) - for (size_t i = 0; (pProfile = json_at(pGroups, i)) != NULL; i++){ + for (size_t i = 0; (pProfile = json_at(pGroups, i)) != NULL; i++) { LONG UserId = -json_as_int(json_get(pProfile, "id")); if (!UserId) continue; @@ -156,12 +156,12 @@ CVKNewsItem* CVkProto::GetVkNewsItem(JSONNODE *pItem, OBJLIST &vkUs debugLog(_T("CVkProto::GetVkNewsItem %d %d %s <%s>"), iSourceId, iPostId, vkNewsItem->tszType.GetBuffer(), tszText.GetBuffer()); - if (vkNewsItem->tszType == _T("photo_tag")){ + if (vkNewsItem->tszType == _T("photo_tag")) { bPostLink = false; JSONNODE *pPhotos = json_get(pItem, "photo_tags"); - if (pPhotos){ + if (pPhotos) { JSONNODE *pPhotoItems = json_get(pPhotos, "items"); - if (pPhotoItems){ + if (pPhotoItems) { JSONNODE *pPhotoItem; tszText = TranslateT("User was tagged in these photos:"); for (size_t i = 0; (pPhotoItem = json_at(pPhotoItems, i)) != NULL; i++) @@ -169,17 +169,17 @@ CVKNewsItem* CVkProto::GetVkNewsItem(JSONNODE *pItem, OBJLIST &vkUs } } } - else if (vkNewsItem->tszType == _T("photo") || vkNewsItem->tszType == _T("wall_photo")){ + else if (vkNewsItem->tszType == _T("photo") || vkNewsItem->tszType == _T("wall_photo")) { bPostLink = false; JSONNODE *pPhotos = json_get(pItem, "photos"); - if (pPhotos){ + if (pPhotos) { JSONNODE *pPhotoItems = json_get(pPhotos, "items"), *pPhotoItem; if (pPhotoItems) - for (size_t i = 0; (pPhotoItem = json_at(pPhotoItems, i)) != NULL; i++){ + for (size_t i = 0; (pPhotoItem = json_at(pPhotoItems, i)) != NULL; i++) { tszText += GetVkPhotoItem(pPhotoItem) + _T("\n"); - if (i == 0 && vkNewsItem->tszType == _T("wall_photo")){ + if (i == 0 && vkNewsItem->tszType == _T("wall_photo")) { LONG iPhotoPostId = json_as_int(json_get(pPhotoItem, "post_id")); - if (iPhotoPostId){ + if (iPhotoPostId) { bPostLink = true; iPostId = iPhotoPostId; break; // max 1 wall_photo when photo post_id !=0 @@ -249,11 +249,11 @@ CMString CVkProto::GetVkFeedback(JSONNODE *pFeedback, VKObjType vkFeedbackType, iUserId = json_as_int(json_get(pFeedback, "owner_id ")); tszFormat = _T("%s %%s %%s\n%s"); } - else if (vkFeedbackType == VKObjType::vkUsers || vkFeedbackType == vkCopy){ + else if (vkFeedbackType == VKObjType::vkUsers || vkFeedbackType == vkCopy) { JSONNODE *pUsers = json_get(pFeedback, "items"), *pUserItem; CMString tszUsers; - for (int i = 0; (pUserItem = json_at(pUsers, i)) != NULL; i++){ + for (int i = 0; (pUserItem = json_at(pUsers, i)) != NULL; i++) { iUserId = json_as_int(json_get(pUserItem, "from_id")); if (iUserId == 0) continue; @@ -267,7 +267,7 @@ CMString CVkProto::GetVkFeedback(JSONNODE *pFeedback, VKObjType vkFeedbackType, iUserId = 0; } - if (iUserId){ + if (iUserId) { vkUser = GetVkUserInfo(iUserId, vkUsers); CMString tszText = json_as_string(json_get(pFeedback, "text")); tszRes.AppendFormat(tszFormat, SetBBCString(vkUser->m_tszUserNick.GetBuffer(), vkbbcUrl, vkUser->m_tszLink.GetBuffer()), ClearFormatNick(tszText).GetBuffer()); @@ -367,14 +367,14 @@ CVKNewsItem* CVkProto::GetVkParent(JSONNODE *pParent, VKObjType vkParentType, TC LONG iId = json_as_int(json_get(pParent, "id")); pNode = json_get(pParent, "post"); - if (pNode){ + if (pNode) { CMString tszRepl; tszRepl.AppendFormat(_T("?reply=%d"), iId); return GetVkParent(pNode, vkPost, tszText.IsEmpty() ? NULL : tszText.GetBuffer(), tszRepl.GetBuffer()); } pNode = json_get(pParent, "topic"); - if (pNode){ + if (pNode) { CMString tszRepl; tszRepl.AppendFormat(_T("?reply=%d"), iId); return GetVkParent(pNode, vkTopic, tszText.IsEmpty() ? NULL : tszText.GetBuffer(), tszRepl.GetBuffer()); @@ -408,7 +408,7 @@ CVKNewsItem* CVkProto::GetVkNotificationsItem(JSONNODE *pItem, OBJLISTtszText.GetBuffer()); vkNotification->tszText = tszNotificaton; @@ -444,7 +444,7 @@ void CVkProto::RetrieveUnreadNews(time_t tLastNewsTime) szFilter += szFilter.IsEmpty() ? "" : ","; szFilter += m_bNewsFilterWallPhotos ? "wall_photo" : ""; - if (szFilter.IsEmpty()){ + if (szFilter.IsEmpty()) { debugLogA("CVkProto::RetrieveUnreadNews szFilter empty"); return; } @@ -461,7 +461,7 @@ void CVkProto::RetrieveUnreadNews(time_t tLastNewsTime) szSource += szSource.IsEmpty() ? "" : ","; szSource += m_bNewsSourceFollowing ? "following" : ""; - if (szSource.IsEmpty()){ + if (szSource.IsEmpty()) { debugLogA("CVkProto::RetrieveUnreadNews szSource empty"); return; } @@ -500,7 +500,7 @@ void CVkProto::OnReceiveUnreadNews(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *p OBJLIST vkNews(5, sttCompareVKNewsItems); if (pItems != NULL) - for (int i = 0; (pItem = json_at(pItems, i)) != NULL; i++){ + for (int i = 0; (pItem = json_at(pItems, i)) != NULL; i++) { CVKNewsItem *vkNewsItem = GetVkNewsItem(pItem, vkUsers); if (!vkNewsItem) continue; @@ -569,7 +569,7 @@ void CVkProto::OnReceiveUnreadNotifications(NETLIBHTTPREQUEST *reply, AsyncHttpR OBJLIST vkNotification(5, sttCompareVKNewsItems); if (pItems != NULL) - for (int i = 0; (pItem = json_at(pItems, i)) != NULL; i++){ + for (int i = 0; (pItem = json_at(pItems, i)) != NULL; i++) { CVKNewsItem *vkNotificationItem = GetVkNotificationsItem(pItem, vkUsers); if (!vkNotificationItem) continue; @@ -611,7 +611,7 @@ INT_PTR CVkProto::SvcLoadVKNews(WPARAM, LPARAM) if (!IsOnline()) return 1; - if (!m_bNewsEnabled && !m_bNotificationsEnabled){ + if (!m_bNewsEnabled && !m_bNotificationsEnabled) { m_bSpecialContactAlwaysEnabled = true; AddFeedSpecialUser(); } diff --git a/protocols/VKontakte/src/vk_files.cpp b/protocols/VKontakte/src/vk_files.cpp index 5399ba4b04..9b7bfbcf66 100644 --- a/protocols/VKontakte/src/vk_files.cpp +++ b/protocols/VKontakte/src/vk_files.cpp @@ -46,7 +46,7 @@ CVkFileUploadParam::VKFileType CVkFileUploadParam::GetType() TCHAR img[] = _T(".jpg .jpeg .png .bmp"); TCHAR audio[] = _T(".mp3"); - TCHAR DRIVE[3], DIR[256], FNAME[256], EXT[256]; + TCHAR DRIVE[3], DIR[256], FNAME[256], EXT[256]; _tsplitpath(FileName, DRIVE, DIR, FNAME, EXT); CMStringA fn; diff --git a/protocols/VKontakte/src/vk_options.cpp b/protocols/VKontakte/src/vk_options.cpp index 8316977d2b..d6feff9be9 100644 --- a/protocols/VKontakte/src/vk_options.cpp +++ b/protocols/VKontakte/src/vk_options.cpp @@ -573,16 +573,16 @@ INT_PTR CALLBACK CVkProto::OptionsViewProc(HWND hwndDlg, UINT uMsg, WPARAM wPara int CVkProto::OnOptionsInit(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = { sizeof(odp) }; - odp.hInstance = hInst; - odp.ptszTitle = m_tszUserName; + odp.hInstance = hInst; + odp.ptszTitle = m_tszUserName; odp.dwInitParam = LPARAM(this); - odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE; - odp.ptszGroup = LPGENT("Network"); + odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE; + odp.ptszGroup = LPGENT("Network"); - odp.ptszTab = LPGENT("Account"); + odp.ptszTab = LPGENT("Account"); odp.position = 1; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_MAIN); - odp.pfnDlgProc = &CVkProto::OptionsProc; + odp.pfnDlgProc = &CVkProto::OptionsProc; Options_AddPage(wParam, &odp); odp.ptszTab = LPGENT("Advanced"); diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index a0f8444fc2..ec8fd83a32 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -418,7 +418,7 @@ DWORD_PTR CVkProto::GetCaps(int type, MCONTACT) return PF2_ONLINE; case PFLAGNUM_4: - return PF4_IMSENDUTF | PF4_AVATARS | PF4_SUPPORTTYPING | PF4_NOAUTHDENYREASON | PF4_IMSENDOFFLINE | PF4_OFFLINEFILES; + return PF4_IMSENDUTF | PF4_AVATARS | PF4_SUPPORTTYPING | PF4_NOAUTHDENYREASON | PF4_IMSENDOFFLINE | PF4_OFFLINEFILES; case PFLAGNUM_5: return PF2_ONTHEPHONE; @@ -461,7 +461,7 @@ int CVkProto::SendMsg(MCONTACT hContact, int flags, const char *msg) if (!IsOnline()) return 0; LONG userID = getDword(hContact, "ID", -1); - if (userID == -1 || userID == VK_FEED_USER){ + if (userID == -1 || userID == VK_FEED_USER) { ForkThread(&CVkProto::SendMsgAck, new TFakeAckParams(hContact, 0)); return 0; } @@ -540,7 +540,7 @@ void CVkProto::OnSendMessage(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq) int CVkProto::SetStatus(int iNewStatus) { - debugLogA("CVkProto::SetStatus iNewStatus = %d, m_iStatus = %d, m_iDesiredStatus = %d", iNewStatus, m_iStatus, m_iDesiredStatus); + debugLogA("CVkProto::SetStatus iNewStatus = %d, m_iStatus = %d, m_iDesiredStatus = %d", iNewStatus, m_iStatus, m_iDesiredStatus); if (m_iDesiredStatus == iNewStatus || iNewStatus == ID_STATUS_IDLE) return 0; diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h index 96ff1b0123..4bbec6bd26 100644 --- a/protocols/VKontakte/src/vk_proto.h +++ b/protocols/VKontakte/src/vk_proto.h @@ -108,7 +108,7 @@ struct CVkChatMessage : public MZeroedObject { CVkChatMessage(int _id) : m_mid(_id) {} - int m_mid, m_uid, m_date; + int m_mid, m_uid, m_date; bool m_bHistory; ptrT m_tszBody; }; @@ -117,7 +117,7 @@ struct CVkChatUser : public MZeroedObject { CVkChatUser(int _id) : m_uid(_id) {} - int m_uid; + int m_uid; bool m_bDel, m_bUnknown; ptrT m_tszNick; }; @@ -164,7 +164,7 @@ struct CVkUserInfo : public MZeroedObject { m_bIsGroup(false) {} - CVkUserInfo(LONG _UserId, bool _bIsGroup, CMString& _tszUserNick, CMString& _tszLink, MCONTACT _hContact = NULL) : + CVkUserInfo(LONG _UserId, bool _bIsGroup, CMString& _tszUserNick, CMString& _tszLink, MCONTACT _hContact = NULL) : m_UserId(_UserId), m_bIsGroup(_bIsGroup), m_tszUserNick(_tszUserNick), @@ -238,48 +238,48 @@ struct CVkProto : public PROTO // PROTO_INTERFACE //==================================================================================== - virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr); - virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent); + virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr); + virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent); - virtual int __cdecl Authorize(HANDLE hDbEvent); - virtual int __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR *szReason); - virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR *szMessage); + virtual int __cdecl Authorize(HANDLE hDbEvent); + virtual int __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR *szReason); + virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR *szMessage); - virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath); - virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer); - virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason); - virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename); + virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath); + virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer); + virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason); + virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename); virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL); - virtual int __cdecl GetInfo(MCONTACT hContact, int infoType); + virtual int __cdecl GetInfo(MCONTACT hContact, int infoType); - virtual HANDLE __cdecl SearchBasic(const TCHAR *id); - virtual HANDLE __cdecl SearchByEmail(const TCHAR *email); - virtual HANDLE __cdecl SearchByName(const TCHAR *nick, const TCHAR *firstName, const TCHAR *lastName); - virtual HWND __cdecl SearchAdvanced(HWND owner); - virtual HWND __cdecl CreateExtendedSearchUI(HWND owner); + virtual HANDLE __cdecl SearchBasic(const TCHAR *id); + virtual HANDLE __cdecl SearchByEmail(const TCHAR *email); + virtual HANDLE __cdecl SearchByName(const TCHAR *nick, const TCHAR *firstName, const TCHAR *lastName); + virtual HWND __cdecl SearchAdvanced(HWND owner); + virtual HWND __cdecl CreateExtendedSearchUI(HWND owner); - virtual int __cdecl RecvContacts(MCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl RecvFile(MCONTACT hContact, PROTORECVFILET*); - virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl RecvUrl(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvContacts(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvFile(MCONTACT hContact, PROTORECVFILET*); + virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvUrl(MCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList); - virtual HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles); - virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg); - virtual int __cdecl SendUrl(MCONTACT hContact, int flags, const char* url); + virtual int __cdecl SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList); + virtual HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles); + virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg); + virtual int __cdecl SendUrl(MCONTACT hContact, int flags, const char* url); - virtual int __cdecl SetApparentMode(MCONTACT hContact, int mode); - virtual int __cdecl SetStatus(int iNewStatus); + virtual int __cdecl SetApparentMode(MCONTACT hContact, int mode); + virtual int __cdecl SetStatus(int iNewStatus); - virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact); - virtual int __cdecl RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt); - virtual int __cdecl SetAwayMsg(int m_iStatus, const TCHAR *msg); + virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact); + virtual int __cdecl RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt); + virtual int __cdecl SetAwayMsg(int m_iStatus, const TCHAR *msg); - virtual int __cdecl UserIsTyping(MCONTACT hContact, int type); + virtual int __cdecl UserIsTyping(MCONTACT hContact, int type); - virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam); + virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam); //==== Events ======================================================================== @@ -318,12 +318,12 @@ struct CVkProto : public PROTO INT_PTR __cdecl SvcGetAllServerHistory(WPARAM hContact, LPARAM); void InitMenus(); void UnInitMenus(); - int __cdecl OnPreBuildContactMenu(WPARAM hContact, LPARAM); + int __cdecl OnPreBuildContactMenu(WPARAM hContact, LPARAM); //==== PopUps ======================================================================== - void InitPopups(void); - void MsgPopup(MCONTACT hContact, const TCHAR *szMsg, const TCHAR *szTitle, bool err = false); + void InitPopups(void); + void MsgPopup(MCONTACT hContact, const TCHAR *szMsg, const TCHAR *szTitle, bool err = false); //==== Hooks ========================================================================= @@ -376,21 +376,21 @@ struct CVkProto : public PROTO //==== Misc ========================================================================== TCHAR* GetUserStoredPassword(void); - void SetAllContactStatuses(int status); - + void SetAllContactStatuses(int status); + MCONTACT FindUser(LONG userid, bool bCreate = false); MCONTACT FindChat(LONG dwUserid); - bool CheckMid(int guid); + bool CheckMid(int guid); JSONNODE* CheckJsonResponse(AsyncHttpRequest *pReq, NETLIBHTTPREQUEST *reply, JSONROOT&); bool CheckJsonResult(AsyncHttpRequest *pReq, JSONNODE*); void OnReceiveSmth(NETLIBHTTPREQUEST*, AsyncHttpRequest*); - bool AutoFillForm(char*, CMStringA&, CMStringA&); + bool AutoFillForm(char*, CMStringA&, CMStringA&); - void GrabCookies(NETLIBHTTPREQUEST *nhr); - void ApplyCookies(AsyncHttpRequest*); + void GrabCookies(NETLIBHTTPREQUEST *nhr); + void ApplyCookies(AsyncHttpRequest*); void DBAddAuthRequest(const MCONTACT hContact); MCONTACT MContactFromDbEvent(HANDLE hDbEvent); @@ -442,7 +442,7 @@ struct CVkProto : public PROTO void RetrievePollingInfo(); void OnReceivePollingInfo(NETLIBHTTPREQUEST*, AsyncHttpRequest*); void __cdecl PollingThread(void*); - int PollServer(); + int PollServer(); void PollUpdates(JSONNODE*); void OnReceivePolling(NETLIBHTTPREQUEST*, AsyncHttpRequest*); @@ -468,7 +468,7 @@ private: mir_cs m_csRequestsQueue; HANDLE m_evRequestsQueue; HANDLE m_hWorkerThread; - bool m_bTerminated, m_bServerDelivery; + bool m_bTerminated, m_bServerDelivery; CMStringA m_prevUrl; enum CLMenuIndexes { @@ -517,26 +517,26 @@ private: OBJLIST m_cookies; - void InitQueue(); - void UninitQueue(); - void ExecuteRequest(AsyncHttpRequest*); - void __cdecl WorkerThread(void*); + void InitQueue(); + void UninitQueue(); + void ExecuteRequest(AsyncHttpRequest*); + void __cdecl WorkerThread(void*); AsyncHttpRequest* Push(AsyncHttpRequest*, int iTimeout = 10000); - bool RunCaptchaForm(LPCSTR szUrl, CMStringA&); - bool ApplyCaptcha(AsyncHttpRequest *pReq, JSONNODE*); + bool RunCaptchaForm(LPCSTR szUrl, CMStringA&); + bool ApplyCaptcha(AsyncHttpRequest *pReq, JSONNODE*); - void ConnectionFailed(int iReason); - void OnLoggedIn(); - void OnLoggedOut(); - void ShutdownSession(); + void ConnectionFailed(int iReason); + void OnLoggedIn(); + void OnLoggedOut(); + void ShutdownSession(); - void SetAvatarUrl(MCONTACT hContact, CMString &tszUrl); - void GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, size_t cbLen); - void ReloadAvatarInfo(MCONTACT hContact); + void SetAvatarUrl(MCONTACT hContact, CMString &tszUrl); + void GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, size_t cbLen); + void ReloadAvatarInfo(MCONTACT hContact); - void __cdecl SendMsgAck(void *param); + void __cdecl SendMsgAck(void *param); //============== Options ============================================================= @@ -590,7 +590,7 @@ private: LONG m_myUserId; ptrT m_defaultGroup; - ptrA + ptrA m_pollingServer, m_pollingKey, m_pollingTs, @@ -602,7 +602,7 @@ private: m_hPopupClassError, m_hPopupClassNotification; - ULONG m_msgId; + ULONG m_msgId; LIST m_sendIds; diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index 4d1aa375f3..ca1a45255b 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -364,7 +364,7 @@ MCONTACT CVkProto::SetContactInfo(JSONNODE* pItem, bool flag, bool self) setTString(hContact, "About", tszValue.GetBuffer()); tszValue = json_as_string(json_get(pItem, "domain")); - if (!tszValue.IsEmpty()){ + if (!tszValue.IsEmpty()) { setTString(hContact, "domain", tszValue.GetBuffer()); CMString tszUrl("https://vk.com/"); tszUrl.Append(tszValue); @@ -548,7 +548,7 @@ void CVkProto::OnReceiveFriends(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq ///////////////////////////////////////////////////////////////////////////////////////// -int CVkProto::OnDbEventRead(WPARAM hContact, LPARAM) +int CVkProto::OnDbEventRead(WPARAM hContact, LPARAM) { debugLogA("CVkProto::OnDbEventRead"); if (m_iMarkMessageReadOn == markOnRead) @@ -1003,10 +1003,10 @@ void CVkProto::RetrieveStatusMusic(const CMString &StatusMsg) CMString oldStatusMsg = db_get_tsa(0, m_szModuleName, "OldStatusMsg"); if (StatusMsg.IsEmpty()) { if (m_iMusicSendMetod == sendBroadcastOnly) - code = "API.audio.setBroadcast();return null;"; + code = "API.audio.setBroadcast();return null;"; else { - CMString codeformat("API.status.set({text:\"%s\"});return null;"); - code.AppendFormat(codeformat, oldStatusMsg); + CMString codeformat("API.status.set({text:\"%s\"});return null;"); + code.AppendFormat(codeformat, oldStatusMsg); } } else { @@ -1025,7 +1025,7 @@ void CVkProto::RetrieveStatusMusic(const CMString &StatusMsg) CMString codeformat("var StatusMsg=\"♫ %s\";var OldMsg=API.status.get();" "API.status.set({\"text\":StatusMsg});" "return OldMsg;"); - code.AppendFormat(codeformat, StatusMsg); + code.AppendFormat(codeformat, StatusMsg); } else if (m_iMusicSendMetod == sendBroadcastAndStatus) { CMString codeformat("var StatusMsg=\"%s\";var CntLmt=100;var Track=\" \";var OldMsg=API.status.get();" -- cgit v1.2.3