summaryrefslogtreecommitdiff
path: root/protocols/Omegle/src/chat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Omegle/src/chat.cpp')
-rw-r--r--protocols/Omegle/src/chat.cpp46
1 files changed, 27 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 };