diff options
author | Robert Pösel <robyer@seznam.cz> | 2014-01-18 07:19:16 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2014-01-18 07:19:16 +0000 |
commit | 3becde66074e1c9693e9cb06d83badb2d859bdfc (patch) | |
tree | a75a4f604205b68926462efd9c7ae87e08801586 /protocols/Omegle | |
parent | 9679609450b807b3c61cdb1baf93ac82fb1a906e (diff) |
Omegle: Fix /asl command
git-svn-id: http://svn.miranda-ng.org/main/trunk@7706 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Omegle')
-rw-r--r-- | protocols/Omegle/src/chat.cpp | 46 | ||||
-rw-r--r-- | protocols/Omegle/src/proto.h | 1 |
2 files changed, 28 insertions, 19 deletions
diff --git a/protocols/Omegle/src/chat.cpp b/protocols/Omegle/src/chat.cpp index 2ab09ef2f0..31fb4ae58b 100644 --- a/protocols/Omegle/src/chat.cpp +++ b/protocols/Omegle/src/chat.cpp @@ -133,6 +133,8 @@ int OmegleProto::OnChatEvent(WPARAM wParam,LPARAM lParam) if ( !getU8String( OMEGLE_KEY_ASL,&dbv )) {
text = dbv.pszVal;
db_free(&dbv);
+
+ SendChatMessage(text);
} else {
UpdateChat(NULL, TranslateT("Your '/asl' setting is empty."), false);
break;
@@ -165,26 +167,9 @@ int OmegleProto::OnChatEvent(WPARAM wParam,LPARAM lParam) break;
}
- } else switch (facy.state_) {
+ } else {
// Outgoing message
-
- case STATE_ACTIVE:
- debugLogA("**Chat - Outgoing message: %s", text.c_str());
- ForkThread(&OmegleProto::SendMsgWorker, new std::string(text));
- break;
-
- case STATE_INACTIVE:
- UpdateChat(NULL, TranslateT("You aren't connected to any stranger. Send '/help' or '/commands' for help."), false);
- break;
-
- case STATE_SPY:
- UpdateChat(NULL, TranslateT("You can't send messages in question mode."), false);
- break;
-
- //case STATE_WAITING:
- //case STATE_DISCONNECTING:
- default:
- break;
+ SendChatMessage(text);
}
break;
@@ -205,6 +190,29 @@ int OmegleProto::OnChatEvent(WPARAM wParam,LPARAM lParam) return 0;
}
+void OmegleProto::SendChatMessage(std::string text)
+{
+ switch (facy.state_) {
+ case STATE_ACTIVE:
+ debugLogA("**Chat - Outgoing message: %s", text.c_str());
+ ForkThread(&OmegleProto::SendMsgWorker, new std::string(text));
+ break;
+
+ case STATE_INACTIVE:
+ UpdateChat(NULL, TranslateT("You aren't connected to any stranger. Send '/help' or '/commands' for help."), false);
+ break;
+
+ case STATE_SPY:
+ UpdateChat(NULL, TranslateT("You can't send messages in question mode."), false);
+ break;
+
+ //case STATE_WAITING:
+ //case STATE_DISCONNECTING:
+ default:
+ break;
+ }
+}
+
/*void OmegleProto::SendChatEvent(int type)
{
GCDEST gcd = { m_szModuleName, m_tszUserName, GC_EVENT_CONTROL };
diff --git a/protocols/Omegle/src/proto.h b/protocols/Omegle/src/proto.h index a27e8f24b9..dc774a56b3 100644 --- a/protocols/Omegle/src/proto.h +++ b/protocols/Omegle/src/proto.h @@ -126,6 +126,7 @@ public: // Chat handling
void AddChat(const TCHAR *id,const TCHAR *name);
void UpdateChat(const TCHAR *name, const TCHAR *message, bool addtochat = true);
+ void SendChatMessage(std::string message);
void AddChatContact(const TCHAR *nick);
void DeleteChatContact(const TCHAR *name);
void SetChatStatus(int);
|