From 3f23417a1099f73dc28ec1b7d6ec2a1a7fc2b7a2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 18 Jun 2012 20:53:59 +0000 Subject: - PLUGININFO structure removed at all; - Options_AddPage & UserInfo_AddPage replaced MS_OPT_ADDPAGE & MS_USERINFO_ADDPAGE services respectively - total internal redesign of options' translation - code reformatting git-svn-id: http://svn.miranda-ng.org/main/trunk@477 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Twitter/main.cpp | 8 +------- protocols/Twitter/proto.cpp | 15 +++------------ protocols/Twitter/proto.h | 2 +- 3 files changed, 5 insertions(+), 20 deletions(-) (limited to 'protocols/Twitter') diff --git a/protocols/Twitter/main.cpp b/protocols/Twitter/main.cpp index 42ffac5220..1aeac73b83 100644 --- a/protocols/Twitter/main.cpp +++ b/protocols/Twitter/main.cpp @@ -102,21 +102,15 @@ int OnModulesLoaded(WPARAM,LPARAM) char curr_version[30]; upd.szComponentName = pluginInfo.shortName; - upd.szUpdateURL = UPDATER_AUTOREGISTER; - upd.szBetaVersionURL = "http://twosx.net/mim/twitter/updater/version.html"; upd.szBetaChangelogURL = "http://twosx.net/mim/twitter/updater/changelog.html"; upd.pbBetaVersionPrefix = reinterpret_cast("Twitter "); upd.cpbBetaVersionPrefix = (int)strlen(reinterpret_cast(upd.pbBetaVersionPrefix)); - upd.szBetaUpdateURL = "http://twosx.net/mim/twitter/updater/twitter.zip"; - - upd.pbVersion = reinterpret_cast( CreateVersionStringPlugin( - reinterpret_cast(&pluginInfo),curr_version) ); + upd.pbVersion = reinterpret_cast( CreateVersionStringPluginEx(&pluginInfo,curr_version) ); upd.cpbVersion = (int)strlen(reinterpret_cast(upd.pbVersion)); - CallService(MS_UPDATE_REGISTER,0,(LPARAM)&upd); } diff --git a/protocols/Twitter/proto.cpp b/protocols/Twitter/proto.cpp index c2108358ae..30b3b90a16 100644 --- a/protocols/Twitter/proto.cpp +++ b/protocols/Twitter/proto.cpp @@ -367,14 +367,14 @@ int TwitterProto::OnOptionsInit(WPARAM wParam,LPARAM lParam) odp.ptszTab = LPGENT("Basic"); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.pfnDlgProc = options_proc; - CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp); + Options_AddPage(wParam,&odp); if(ServiceExists(MS_POPUP_ADDPOPUPT)) { odp.ptszTab = LPGENT("Popups"); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS_POPUPS); odp.pfnDlgProc = popup_options_proc; - CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp); + Options_AddPage(wParam,&odp); } return 0; @@ -525,23 +525,14 @@ void TwitterProto::LOG(TCHAR *fmt,...) CallService(MS_NETLIB_LOG, (WPARAM)hNetlib_, (LPARAM)( char* )_T2A(text)); } -void TwitterProto::WLOG(TCHAR* first, const wstring last) -{ - TCHAR *str1 = new TCHAR[1024*96]; - _stprintf(str1,_T("%s"), last.c_str()); - LOG(first, str1); -} - // TODO: the more I think about it, the more I think all twit.* methods should // be in MessageLoop void TwitterProto::SendTweetWorker(void *p) { if(p == 0) return; - char *text = static_cast(p); - - + char *text = static_cast(p); if (strlen(text) > 140) { // looks like the chat max outgoing msg thing doesn't work, so i'll do it here. char * errorPopup = new char[280]; // i hate c strings ... i should use std::string here. why did i use char* ??? need to delete[] or use std::String sprintf(errorPopup, "Don't be crazy! Everyone knows the max tweet size is 140, and you're trying to fit %d chars in there?", strlen(text)); diff --git a/protocols/Twitter/proto.h b/protocols/Twitter/proto.h index ca3fd8596c..6cea35b33d 100644 --- a/protocols/Twitter/proto.h +++ b/protocols/Twitter/proto.h @@ -147,7 +147,7 @@ private: void SetAllContactStatuses(int); void LOG(TCHAR *fmt,...); - void WLOG(TCHAR* first, const wstring last); + __inline void WLOG(TCHAR* first, const tstring& last) { LOG(first, last.c_str()); } static void CALLBACK APC_callback(ULONG_PTR p); void UpdateChat(const twitter_user &update); -- cgit v1.2.3