From fee85fe9916e603d9fdd7e6c61e1f3380df59d51 Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Fri, 3 Jul 2015 20:56:56 +0000 Subject: Twitter: - Fixed retweets (broken after r13248) - minor cleantup git-svn-id: http://svn.miranda-ng.org/main/trunk@14486 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Twitter/src/proto.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'protocols/Twitter/src/proto.cpp') diff --git a/protocols/Twitter/src/proto.cpp b/protocols/Twitter/src/proto.cpp index fa1daf0957..3891325d47 100644 --- a/protocols/Twitter/src/proto.cpp +++ b/protocols/Twitter/src/proto.cpp @@ -217,13 +217,14 @@ INT_PTR TwitterProto::GetStatus(WPARAM, LPARAM) return m_iStatus; } -INT_PTR TwitterProto::ReplyToTweet(WPARAM hContact, LPARAM) +INT_PTR TwitterProto::ReplyToTweet(WPARAM wParam, LPARAM) { + MCONTACT hContact = (MCONTACT) wParam; // TODO: support replying to tweets instead of just users HWND hDlg = CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_TWEET), 0, tweet_proc, reinterpret_cast(this)); DBVARIANT dbv; - if (!db_get_s(hContact, m_szModuleName, TWITTER_KEY_UN, &dbv)) { + if (!getString(hContact, TWITTER_KEY_UN, &dbv)) { SendMessage(hDlg, WM_SETREPLY, reinterpret_cast(dbv.pszVal), 0); db_free(&dbv); } @@ -233,13 +234,14 @@ INT_PTR TwitterProto::ReplyToTweet(WPARAM hContact, LPARAM) return 0; } -INT_PTR TwitterProto::VisitHomepage(WPARAM hContact, LPARAM) +INT_PTR TwitterProto::VisitHomepage(WPARAM wParam, LPARAM) { + MCONTACT hContact = (MCONTACT) wParam; DBVARIANT dbv; // TODO: remove this - if (!db_get_s(hContact, m_szModuleName, TWITTER_KEY_UN, &dbv)) { + if (!getString(hContact, TWITTER_KEY_UN, &dbv)) { std::string url = profile_base_url("https://twitter.com/") + http::url_encode(dbv.pszVal); - db_set_s(hContact, m_szModuleName, "Homepage", url.c_str()); + setString(hContact, "Homepage", url.c_str()); Utils_OpenUrl(url.c_str()); db_free(&dbv); @@ -359,8 +361,9 @@ int TwitterProto::OnPreShutdown(WPARAM, LPARAM) return 0; } -int TwitterProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM) +int TwitterProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM) { + MCONTACT hContact = (MCONTACT) wParam; if (IsMyContact(hContact)) ShowContactMenus(true); @@ -432,7 +435,7 @@ void TwitterProto::SendTweetWorker(void *p) void TwitterProto::UpdateSettings() { - if (db_get_b(0, m_szModuleName, TWITTER_KEY_CHATFEED, 0)) { + if (getByte(TWITTER_KEY_CHATFEED)) { if (!in_chat_) OnJoinChat(0, 0); } -- cgit v1.2.3