diff options
Diffstat (limited to 'protocols/Omegle/src')
-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);
|