From 8994046b8cd70f9672edf62d118ef066714c005f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Wed, 23 Apr 2014 15:42:36 +0000 Subject: Omegle: Support sending typing notifications (for TabSRMM only), version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@9062 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Omegle/src/chat.cpp | 5 ----- protocols/Omegle/src/messages.cpp | 10 +++++----- protocols/Omegle/src/proto.cpp | 12 ++++++++++-- protocols/Omegle/src/stubs.cpp | 5 ----- protocols/Omegle/src/version.h | 4 ++-- 5 files changed, 17 insertions(+), 19 deletions(-) (limited to 'protocols/Omegle/src') diff --git a/protocols/Omegle/src/chat.cpp b/protocols/Omegle/src/chat.cpp index f9dac49e91..007a8cbd38 100644 --- a/protocols/Omegle/src/chat.cpp +++ b/protocols/Omegle/src/chat.cpp @@ -175,11 +175,6 @@ int OmegleProto::OnChatEvent(WPARAM wParam,LPARAM lParam) break; } - case GC_USER_TYPNOTIFY: - if ( facy.state_ == STATE_ACTIVE ) - ForkThread(&OmegleProto::SendTypingWorker, mir_tstrdup(hook->ptszText)); - break; - case GC_USER_LEAVE: case GC_SESSION_TERMINATE: mir_free( facy.nick_ ); diff --git a/protocols/Omegle/src/messages.cpp b/protocols/Omegle/src/messages.cpp index 4ec6ef36fe..e7655c421c 100644 --- a/protocols/Omegle/src/messages.cpp +++ b/protocols/Omegle/src/messages.cpp @@ -49,17 +49,17 @@ void OmegleProto::SendTypingWorker(void *p) return; // Save typing info - bool typ = !_tcscmp(static_cast(p), _T("1")); - mir_free(p); + bool typ = (*static_cast(p) == PROTOTYPE_SELFTYPING_ON); + delete p; // Ignore same typing info - if ( facy.typing_ == typ ) + if (facy.typing_ == typ) return; facy.typing_ = typ; // Wait for eventually changes to typing info by other thread and ignore if changed - SleepEx( 2000, true ); - if ( facy.typing_ != typ || facy.old_typing_ == typ || facy.state_ != STATE_ACTIVE ) + SleepEx(2000, true); + if (facy.typing_ != typ || facy.old_typing_ == typ || facy.state_ != STATE_ACTIVE) return; facy.old_typing_ = typ; diff --git a/protocols/Omegle/src/proto.cpp b/protocols/Omegle/src/proto.cpp index 29612b1a75..e8cc0c4d42 100644 --- a/protocols/Omegle/src/proto.cpp +++ b/protocols/Omegle/src/proto.cpp @@ -90,7 +90,7 @@ DWORD_PTR OmegleProto::GetCaps( int type, MCONTACT hContact ) case PFLAGNUM_2: return PF2_ONLINE; case PFLAGNUM_4: - return PF4_IMSENDUTF; // | PF4_SUPPORTTYPING; + return PF4_IMSENDUTF | PF4_SUPPORTTYPING; case PFLAG_MAXLENOFMESSAGE: return OMEGLE_MESSAGE_LIMIT; case PFLAG_UNIQUEIDTEXT: @@ -174,7 +174,7 @@ int OmegleProto::OnModulesLoaded(WPARAM wParam,LPARAM lParam) { // Register group chat GCREGISTER gcr = {sizeof(gcr)}; - gcr.dwFlags = GC_TYPNOTIF; //GC_ACKMSG; + gcr.dwFlags = 0; //GC_TYPNOTIF; //GC_ACKMSG; gcr.pszModule = m_szModuleName; gcr.ptszDispName = m_tszUserName; gcr.iMaxText = OMEGLE_MESSAGE_LIMIT; @@ -215,3 +215,11 @@ int OmegleProto::OnContactDeleted(WPARAM wparam,LPARAM) OnLeaveChat(NULL, NULL); return 0; } + +int OmegleProto::UserIsTyping(MCONTACT hContact, int type) +{ + if (hContact && facy.state_ == STATE_ACTIVE) + ForkThread(&OmegleProto::SendTypingWorker, new int(type)); + + return 0; +} diff --git a/protocols/Omegle/src/stubs.cpp b/protocols/Omegle/src/stubs.cpp index 2e0dc3e3e0..f325d90c0e 100644 --- a/protocols/Omegle/src/stubs.cpp +++ b/protocols/Omegle/src/stubs.cpp @@ -142,11 +142,6 @@ int OmegleProto::RecvAwayMsg(MCONTACT hContact,int mode,PROTORECVEVENT *evt) return 1; } -int OmegleProto::UserIsTyping(MCONTACT hContact, int type) -{ - return 1; -} - int OmegleProto::SetAwayMsg(int iStatus, const PROTOCHAR* msg) { return 1; diff --git a/protocols/Omegle/src/version.h b/protocols/Omegle/src/version.h index 79ebdd64ef..ea0681a0dd 100644 --- a/protocols/Omegle/src/version.h +++ b/protocols/Omegle/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0 #define __MINOR_VERSION 1 #define __RELEASE_NUM 2 -#define __BUILD_NUM 0 +#define __BUILD_NUM 1 #include @@ -12,4 +12,4 @@ #define __AUTHOR "Robert P\xf6" "sel" #define __AUTHOREMAIL "robyer@seznam.cz" #define __AUTHORWEB "http://miranda-ng.org/p/Omegle/" -#define __COPYRIGHT "© 2011-13 Robert P\xf6" "sel" +#define __COPYRIGHT "© 2011-14 Robert P\xf6" "sel" -- cgit v1.2.3