summaryrefslogtreecommitdiff
path: root/protocols/Omegle
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2014-04-23 15:42:36 +0000
committerRobert Pösel <robyer@seznam.cz>2014-04-23 15:42:36 +0000
commit8994046b8cd70f9672edf62d118ef066714c005f (patch)
tree310b18292ced4c0840a498aa0c3bfc4f739eb1da /protocols/Omegle
parent662444edcced26a7e650aa3ea6b511b8f3db95b0 (diff)
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
Diffstat (limited to 'protocols/Omegle')
-rw-r--r--protocols/Omegle/src/chat.cpp5
-rw-r--r--protocols/Omegle/src/messages.cpp10
-rw-r--r--protocols/Omegle/src/proto.cpp12
-rw-r--r--protocols/Omegle/src/stubs.cpp5
-rw-r--r--protocols/Omegle/src/version.h4
5 files changed, 17 insertions, 19 deletions
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<TCHAR*>(p), _T("1"));
- mir_free(p);
+ bool typ = (*static_cast<int*>(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 <stdver.h>
@@ -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"