From a7ecea148c70da66f744a0036f985bc97804d8b4 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 26 Apr 2015 22:24:58 +0000 Subject: unified project for Twitter git-svn-id: http://svn.miranda-ng.org/main/trunk@13181 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Twitter/src/chat.cpp | 2 +- protocols/Twitter/src/connection.cpp | 4 +- protocols/Twitter/src/contacts.cpp | 6 +- protocols/Twitter/src/main.cpp | 2 +- protocols/Twitter/src/oauth.cpp | 9 +- protocols/Twitter/src/proto.cpp | 7 +- protocols/Twitter/src/stdafx.cpp | 19 -- protocols/Twitter/src/stdafx.cxx | 19 ++ protocols/Twitter/src/utility.h | 5 - protocols/Twitter/twitter.vcxproj | 33 +++ protocols/Twitter/twitter.vcxproj.filters | 335 +++++++++++++++++++++++++++ protocols/Twitter/twitter_10.vcxproj | 208 ----------------- protocols/Twitter/twitter_10.vcxproj.filters | 101 -------- protocols/Twitter/twitter_12.vcxproj | 211 ----------------- protocols/Twitter/twitter_12.vcxproj.filters | 101 -------- 15 files changed, 400 insertions(+), 662 deletions(-) delete mode 100644 protocols/Twitter/src/stdafx.cpp create mode 100644 protocols/Twitter/src/stdafx.cxx create mode 100644 protocols/Twitter/twitter.vcxproj create mode 100644 protocols/Twitter/twitter.vcxproj.filters delete mode 100644 protocols/Twitter/twitter_10.vcxproj delete mode 100644 protocols/Twitter/twitter_10.vcxproj.filters delete mode 100644 protocols/Twitter/twitter_12.vcxproj delete mode 100644 protocols/Twitter/twitter_12.vcxproj.filters (limited to 'protocols') diff --git a/protocols/Twitter/src/chat.cpp b/protocols/Twitter/src/chat.cpp index 30e357a7bc..17ded4336d 100644 --- a/protocols/Twitter/src/chat.cpp +++ b/protocols/Twitter/src/chat.cpp @@ -56,7 +56,7 @@ void TwitterProto::UpdateChat(const twitter_user &update) mir_free(const_cast(gce.ptszText)); } -int TwitterProto::OnChatOutgoing(WPARAM wParam, LPARAM lParam) +int TwitterProto::OnChatOutgoing(WPARAM, LPARAM lParam) { GCHOOK *hook = reinterpret_cast(lParam); if (strcmp(hook->pDest->pszModule, m_szModuleName)) diff --git a/protocols/Twitter/src/connection.cpp b/protocols/Twitter/src/connection.cpp index 2db1d892b9..a92ea20cc6 100644 --- a/protocols/Twitter/src/connection.cpp +++ b/protocols/Twitter/src/connection.cpp @@ -571,7 +571,7 @@ void TwitterProto::UpdateStatuses(bool pre_read, bool popups, bool tweetToMsg) } if (!updates.empty()) - since_id_ = std::max(since_id_, updates[0].status.id); + since_id_ = max(since_id_, updates[0].status.id); for (twitter::status_list::reverse_iterator i = updates.rbegin(); i != updates.rend(); ++i) { @@ -634,7 +634,7 @@ void TwitterProto::UpdateMessages(bool pre_read) } if (messages.size()) - dm_since_id_ = std::max(dm_since_id_, messages[0].status.id); + dm_since_id_ = max(dm_since_id_, messages[0].status.id); for (twitter::status_list::reverse_iterator i = messages.rbegin(); i != messages.rend(); ++i) { MCONTACT hContact = AddToClientList(i->username.c_str(), ""); diff --git a/protocols/Twitter/src/contacts.cpp b/protocols/Twitter/src/contacts.cpp index ffbabc4503..674516a5b3 100644 --- a/protocols/Twitter/src/contacts.cpp +++ b/protocols/Twitter/src/contacts.cpp @@ -44,7 +44,7 @@ void TwitterProto::AddToListWorker(void *p) mir_free(name); } -MCONTACT TwitterProto::AddToList(int flags, PROTOSEARCHRESULT *result) +MCONTACT TwitterProto::AddToList(int, PROTOSEARCHRESULT *result) { if (m_iStatus != ID_STATUS_ONLINE) return 0; @@ -172,7 +172,7 @@ HANDLE TwitterProto::GetAwayMsg(MCONTACT hContact) return (HANDLE)1; } -int TwitterProto::OnContactDeleted(WPARAM hContact, LPARAM lParam) +int TwitterProto::OnContactDeleted(WPARAM hContact, LPARAM) { if (m_iStatus != ID_STATUS_ONLINE) return 0; @@ -264,7 +264,7 @@ void TwitterProto::SetAllContactStatuses(int status) { for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) if (!db_get_b(hContact, m_szModuleName, "ChatRoom", 0)) - db_set_w(hContact, m_szModuleName, "Status", status); + db_set_w(hContact, m_szModuleName, "Status", (WORD)status); SetChatStatus(status); } diff --git a/protocols/Twitter/src/main.cpp b/protocols/Twitter/src/main.cpp index 53081ab253..a35ee2916e 100644 --- a/protocols/Twitter/src/main.cpp +++ b/protocols/Twitter/src/main.cpp @@ -57,7 +57,7 @@ DWORD WINAPI DllMain(HINSTANCE hInstance, DWORD, LPVOID) return TRUE; } -extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { return &pluginInfo; } diff --git a/protocols/Twitter/src/oauth.cpp b/protocols/Twitter/src/oauth.cpp index 8458004e42..b2d8aa4795 100644 --- a/protocols/Twitter/src/oauth.cpp +++ b/protocols/Twitter/src/oauth.cpp @@ -145,10 +145,7 @@ wstring mir_twitter::OAuthWebRequestSubmit( return OAuthWebRequestSubmit(oauthSignedParameters, url); } -wstring mir_twitter::OAuthWebRequestSubmit( - const OAuthParameters& parameters, - const wstring& url - ) +wstring mir_twitter::OAuthWebRequestSubmit(const OAuthParameters ¶meters, const wstring&) { //debugLogW("OAuthWebRequestSubmit(%s)", url); @@ -377,8 +374,8 @@ wstring mir_twitter::OAuthCreateNonce() wstring mir_twitter::OAuthCreateTimestamp() { __time64_t utcNow; - __time64_t ret = _time64(&utcNow); - _ASSERTE(ret != -1); + _time64(&utcNow); + _ASSERTE(utcNow != -1); wchar_t buf[100] = {}; mir_snwprintf(buf, SIZEOF(buf), L"%I64u", utcNow); diff --git a/protocols/Twitter/src/proto.cpp b/protocols/Twitter/src/proto.cpp index b7e32117dc..820c67d1e2 100644 --- a/protocols/Twitter/src/proto.cpp +++ b/protocols/Twitter/src/proto.cpp @@ -274,8 +274,7 @@ int TwitterProto::OnBuildStatusMenu(WPARAM, LPARAM) mi.hParentMenu = hRoot; mi.flags = CMIF_ROOTHANDLE | CMIF_TCHAR; mi.position = 1001; - - HANDLE m_hMenuRoot = Menu_AddStatusMenuItem(&mi); + Menu_AddStatusMenuItem(&mi); // TODO: Disable this menu item when offline // "Send Tweet..." @@ -284,7 +283,7 @@ int TwitterProto::OnBuildStatusMenu(WPARAM, LPARAM) mi.ptszName = LPGENT("Send Tweet..."); mi.popupPosition = 200001; mi.icolibItem = GetIconHandle("tweet"); - HANDLE m_hMenuBookmarks = Menu_AddStatusMenuItem(&mi); + Menu_AddStatusMenuItem(&mi); return 0; } @@ -391,7 +390,7 @@ void TwitterProto::ShowPopup(const wchar_t *text, int Error) { POPUPDATAT popup = {}; mir_sntprintf(popup.lptzContactName, SIZEOF(popup.lptzContactName), TranslateT("%s Protocol"), m_tszUserName); - wcs_to_tcs(CP_UTF8, text, popup.lptzText, SIZEOF(popup.lptzText)); + wcsncpy_s(popup.lptzText, text, _TRUNCATE); if (Error) { popup.iSeconds = -1; diff --git a/protocols/Twitter/src/stdafx.cpp b/protocols/Twitter/src/stdafx.cpp deleted file mode 100644 index fd705e1c02..0000000000 --- a/protocols/Twitter/src/stdafx.cpp +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright © 2012-15 Miranda NG team -Copyright © 2009 Jim Porter - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "stdafx.h" \ No newline at end of file diff --git a/protocols/Twitter/src/stdafx.cxx b/protocols/Twitter/src/stdafx.cxx new file mode 100644 index 0000000000..fd705e1c02 --- /dev/null +++ b/protocols/Twitter/src/stdafx.cxx @@ -0,0 +1,19 @@ +/* +Copyright © 2012-15 Miranda NG team +Copyright © 2009 Jim Porter + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "stdafx.h" \ No newline at end of file diff --git a/protocols/Twitter/src/utility.h b/protocols/Twitter/src/utility.h index 017fd2e9be..fec8d6b23c 100644 --- a/protocols/Twitter/src/utility.h +++ b/protocols/Twitter/src/utility.h @@ -92,9 +92,4 @@ inline void mbcs_to_tcs(UINT code_page, const char *mbstr, TCHAR *tstr, int tlen MultiByteToWideChar(code_page, 0, mbstr, -1, tstr, tlen); } -inline void wcs_to_tcs(UINT code_page, const wchar_t *wstr, TCHAR *tstr, int tlen) -{ - wcsncpy(tstr, wstr, tlen); -} - bool save_url(HANDLE hNetlib,const std::string &url,const std::tstring &filename); \ No newline at end of file diff --git a/protocols/Twitter/twitter.vcxproj b/protocols/Twitter/twitter.vcxproj new file mode 100644 index 0000000000..7259810682 --- /dev/null +++ b/protocols/Twitter/twitter.vcxproj @@ -0,0 +1,33 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {12FFF2B0-0D0B-430B-A4C6-1577CA98F598} + Twitter + + + + + + + Sync + + + \ No newline at end of file diff --git a/protocols/Twitter/twitter.vcxproj.filters b/protocols/Twitter/twitter.vcxproj.filters new file mode 100644 index 0000000000..6e2fab6493 --- /dev/null +++ b/protocols/Twitter/twitter.vcxproj.filters @@ -0,0 +1,335 @@ + + + + + + Source Files + + + Source Files + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + Header Files + + + Header Files + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + Resource Files + + + + Resource Files + + + + \ No newline at end of file diff --git a/protocols/Twitter/twitter_10.vcxproj b/protocols/Twitter/twitter_10.vcxproj deleted file mode 100644 index 3b83454ddb..0000000000 --- a/protocols/Twitter/twitter_10.vcxproj +++ /dev/null @@ -1,208 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {12FFF2B0-0D0B-430B-A4C6-1577CA98F598} - Twitter - - - - DynamicLibrary - Unicode - true - - - DynamicLibrary - Unicode - true - - - DynamicLibrary - Unicode - - - DynamicLibrary - Unicode - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - true - - - - Disabled - ..\..\include;..\..\plugins\ExternalAPI;..\..\..\boost;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;_USRDLL;TWITTER_EXPORTS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level3 - EditAndContinue - Use - - - true - Windows - $(IntDir)$(TargetName).lib - false - $(ProfileDir)..\..\bin10\lib - - - _DEBUG;%(PreprocessorDefinitions) - ..\..\include\msapi - - - - - Disabled - ..\..\include;..\..\plugins\ExternalAPI;..\..\..\boost;%(AdditionalIncludeDirectories) - _WINDOWS;_USRDLL;TWITTER_EXPORTS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level3 - Use - - - true - Windows - $(IntDir)$(TargetName).lib - false - $(ProfileDir)..\..\bin10\lib - - - _DEBUG;%(PreprocessorDefinitions) - ..\..\include\msapi - - - - - ..\..\include;..\..\plugins\ExternalAPI;..\..\..\boost;%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;_USRDLL;TWITTER_EXPORTS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;%(PreprocessorDefinitions) - Level3 - Full - OnlyExplicitInline - Size - Use - - - true - Windows - true - true - $(IntDir)$(TargetName).lib - false - $(ProfileDir)..\..\bin10\lib - /PDBALTPATH:%_PDB% - - - ..\..\include\msapi - NDEBUG;%(PreprocessorDefinitions) - - - - - ..\..\include;..\..\plugins\ExternalAPI;..\..\..\boost;%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;_USRDLL;TWITTER_EXPORTS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;%(PreprocessorDefinitions) - Level3 - Full - OnlyExplicitInline - Size - Use - - - true - Windows - true - true - $(IntDir)$(TargetName).lib - false - $(ProfileDir)..\..\bin10\lib - /PDBALTPATH:%_PDB% - - - ..\..\include\msapi - NDEBUG;%(PreprocessorDefinitions) - - - - - - - - - - - - Create - Create - Create - Create - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/protocols/Twitter/twitter_10.vcxproj.filters b/protocols/Twitter/twitter_10.vcxproj.filters deleted file mode 100644 index 42adbdce6a..0000000000 --- a/protocols/Twitter/twitter_10.vcxproj.filters +++ /dev/null @@ -1,101 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - Resource Files - - - \ No newline at end of file diff --git a/protocols/Twitter/twitter_12.vcxproj b/protocols/Twitter/twitter_12.vcxproj deleted file mode 100644 index 6b318366d1..0000000000 --- a/protocols/Twitter/twitter_12.vcxproj +++ /dev/null @@ -1,211 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {12FFF2B0-0D0B-430B-A4C6-1577CA98F598} - Twitter - - - - DynamicLibrary - Unicode - true - v120_xp - - - DynamicLibrary - Unicode - true - v120_xp - - - DynamicLibrary - Unicode - v120_xp - - - DynamicLibrary - Unicode - v120_xp - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - true - - - - Disabled - ..\..\include;..\..\plugins\ExternalAPI;..\..\..\boost;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;_USRDLL;TWITTER_EXPORTS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level3 - EditAndContinue - Use - - - true - Windows - $(IntDir)$(TargetName).lib - false - $(ProfileDir)..\..\bin12\lib - false - - - _DEBUG;%(PreprocessorDefinitions) - ..\..\include\msapi - - - - - Disabled - ..\..\include;..\..\plugins\ExternalAPI;..\..\..\boost;%(AdditionalIncludeDirectories) - _WINDOWS;_USRDLL;TWITTER_EXPORTS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level3 - Use - - - true - Windows - $(IntDir)$(TargetName).lib - false - $(ProfileDir)..\..\bin12\lib - - - _DEBUG;%(PreprocessorDefinitions) - ..\..\include\msapi - - - - - ..\..\include;..\..\plugins\ExternalAPI;..\..\..\boost;%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;_USRDLL;TWITTER_EXPORTS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;%(PreprocessorDefinitions) - Level3 - Full - OnlyExplicitInline - Size - Use - - - true - Windows - true - true - $(IntDir)$(TargetName).lib - false - $(ProfileDir)..\..\bin12\lib - - - ..\..\include\msapi - NDEBUG;%(PreprocessorDefinitions) - - - - - ..\..\include;..\..\plugins\ExternalAPI;..\..\..\boost;%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;_USRDLL;TWITTER_EXPORTS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;%(PreprocessorDefinitions) - Level3 - Full - OnlyExplicitInline - Size - Use - - - true - Windows - true - true - $(IntDir)$(TargetName).lib - false - $(ProfileDir)..\..\bin12\lib - - - ..\..\include\msapi - NDEBUG;%(PreprocessorDefinitions) - - - - - - - - - - - - Create - Create - Create - Create - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/protocols/Twitter/twitter_12.vcxproj.filters b/protocols/Twitter/twitter_12.vcxproj.filters deleted file mode 100644 index 42adbdce6a..0000000000 --- a/protocols/Twitter/twitter_12.vcxproj.filters +++ /dev/null @@ -1,101 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - Resource Files - - - \ No newline at end of file -- cgit v1.2.3