summaryrefslogtreecommitdiff
path: root/protocols/Omegle
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2013-05-16 20:46:27 +0000
committerRobert Pösel <robyer@seznam.cz>2013-05-16 20:46:27 +0000
commit296157204cb8c89827ee68c39f5e1783d2de7e86 (patch)
tree0f923ec1c6530e45dfc7c5e2725d2e92afe09bb2 /protocols/Omegle
parent693b7a10ad35934e9e91656642e2c2321b27fab3 (diff)
Omegle:
- Show in status bar when Stranger is typing - Added option to chose language of Stranger - Use version.h file - Updated copyright year - Small fixes. - Version bump. git-svn-id: http://svn.miranda-ng.org/main/trunk@4691 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Omegle')
-rw-r--r--protocols/Omegle/omegle_10.vcxproj2
-rw-r--r--protocols/Omegle/omegle_10.vcxproj.filters6
-rw-r--r--protocols/Omegle/omegle_11.vcxproj1
-rw-r--r--protocols/Omegle/omegle_11.vcxproj.filters3
-rw-r--r--protocols/Omegle/res/omegle.rc185
-rw-r--r--protocols/Omegle/res/version.rc38
-rw-r--r--protocols/Omegle/src/chat.cpp33
-rw-r--r--protocols/Omegle/src/client.h5
-rw-r--r--protocols/Omegle/src/common.h5
-rw-r--r--protocols/Omegle/src/communication.cpp36
-rw-r--r--protocols/Omegle/src/connection.cpp2
-rw-r--r--protocols/Omegle/src/constants.h92
-rw-r--r--protocols/Omegle/src/db.h3
-rw-r--r--protocols/Omegle/src/dialogs.cpp22
-rw-r--r--protocols/Omegle/src/dialogs.h2
-rw-r--r--protocols/Omegle/src/events.cpp2
-rw-r--r--protocols/Omegle/src/http.cpp2
-rw-r--r--protocols/Omegle/src/http.h2
-rw-r--r--protocols/Omegle/src/main.cpp16
-rw-r--r--protocols/Omegle/src/messages.cpp2
-rw-r--r--protocols/Omegle/src/process.cpp2
-rw-r--r--protocols/Omegle/src/proto.cpp2
-rw-r--r--protocols/Omegle/src/proto.h3
-rw-r--r--protocols/Omegle/src/resource.h4
-rw-r--r--protocols/Omegle/src/stubs.cpp2
-rw-r--r--protocols/Omegle/src/theme.cpp2
-rw-r--r--protocols/Omegle/src/theme.h2
-rw-r--r--protocols/Omegle/src/utils.cpp2
-rw-r--r--protocols/Omegle/src/utils.h2
-rw-r--r--protocols/Omegle/src/version.h21
30 files changed, 329 insertions, 172 deletions
diff --git a/protocols/Omegle/omegle_10.vcxproj b/protocols/Omegle/omegle_10.vcxproj
index e453bec912..22020d375f 100644
--- a/protocols/Omegle/omegle_10.vcxproj
+++ b/protocols/Omegle/omegle_10.vcxproj
@@ -201,9 +201,11 @@
<ClInclude Include="src\theme.h" />
<ClInclude Include="src\utils.h" />
<ClInclude Include="src\resource.h" />
+ <ClInclude Include="src\version.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res\omegle.rc" />
+ <ResourceCompile Include="res\version.rc" />
</ItemGroup>
<ItemGroup>
<None Include="res\omegle.ico" />
diff --git a/protocols/Omegle/omegle_10.vcxproj.filters b/protocols/Omegle/omegle_10.vcxproj.filters
index ae6518148d..b28798a212 100644
--- a/protocols/Omegle/omegle_10.vcxproj.filters
+++ b/protocols/Omegle/omegle_10.vcxproj.filters
@@ -86,11 +86,17 @@
<ClInclude Include="src\dialogs.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="src\version.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res\omegle.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
+ <ResourceCompile Include="res\version.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
</ItemGroup>
<ItemGroup>
<None Include="res\omegle.ico">
diff --git a/protocols/Omegle/omegle_11.vcxproj b/protocols/Omegle/omegle_11.vcxproj
index ae0726d836..a304910eec 100644
--- a/protocols/Omegle/omegle_11.vcxproj
+++ b/protocols/Omegle/omegle_11.vcxproj
@@ -207,6 +207,7 @@
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res\omegle.rc" />
+ <ResourceCompile Include="res\version.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
diff --git a/protocols/Omegle/omegle_11.vcxproj.filters b/protocols/Omegle/omegle_11.vcxproj.filters
index 1dbee5e29b..9132493e95 100644
--- a/protocols/Omegle/omegle_11.vcxproj.filters
+++ b/protocols/Omegle/omegle_11.vcxproj.filters
@@ -91,5 +91,8 @@
<ResourceCompile Include="res\omegle.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
+ <ResourceCompile Include="res\version.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
</ItemGroup>
</Project> \ No newline at end of file
diff --git a/protocols/Omegle/res/omegle.rc b/protocols/Omegle/res/omegle.rc
index 61481f7302..d1226cf03d 100644
--- a/protocols/Omegle/res/omegle.rc
+++ b/protocols/Omegle/res/omegle.rc
@@ -19,6 +19,41 @@
LANGUAGE LANG_CZECH, SUBLANG_DEFAULT
#pragma code_page(1250)
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "..\\src\\resource.h\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "#include ""..\\src\\constants.h""\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "\r\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_OMEGLE ICON "omegle.ico"
+
+
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
@@ -29,10 +64,12 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
- COMBOBOX IDC_SERVER,84,7,130,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- LTEXT "Server:",IDC_STATIC,24,9,60,8
- LTEXT "Visible name:",IDC_STATIC,24,25,60,8
- EDITTEXT IDC_NAME,84,22,130,14,ES_AUTOHSCROLL
+ LTEXT "Server:",IDC_STATIC,24,9,56,8,0,WS_EX_RIGHT
+ COMBOBOX IDC_SERVER,84,7,74,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Language:",IDC_STATIC,162,9,56,8,0,WS_EX_RIGHT
+ COMBOBOX IDC_LANGUAGE,222,7,74,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Visible name:",IDC_STATIC,24,25,56,8,0,WS_EX_RIGHT
+ EDITTEXT IDC_NAME,84,22,74,14,ES_AUTOHSCROLL
CONTROL "Meet strangers with common interests (separated by commas):",IDC_MEET_COMMON,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,39,272,10
EDITTEXT IDC_INTERESTS,24,49,272,20,ES_MULTILINE | ES_AUTOVSCROLL | WS_VSCROLL
@@ -47,56 +84,16 @@ BEGIN
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,167,272,10
CONTROL "Automatically connect to stranger when protocol is turned online",IDC_AUTO_CONNECT,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,180,272,10
- CONTROL "Automatically connect to another stranger when current disconnects",IDC_DONTSTOP,
+ CONTROL "Automatically connect to another stranger when current disconnects",IDC_DONTSTOP,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,192,272,10
- CONTROL "Don't clear chat before connecting to new stranger",IDC_NOCLEAR,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,204,272,10
+ CONTROL "Don't clear chat before connecting to new stranger",IDC_NOCLEAR,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,204,272,10
CONTROL "Load count of users on actual server after connection",IDC_SERVER_INFO,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,216,272,10
CONTROL "Enable logging for debugging purposes",IDC_LOGGING,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,228,272,10
-
END
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
-BEGIN
- IDD_OPTIONS, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 309
- VERTGUIDE, 24
- VERTGUIDE, 84
- VERTGUIDE, 214
- VERTGUIDE, 296
- TOPMARGIN, 7
- BOTTOMMARGIN, 241
- END
-END
-#endif // APSTUDIO_INVOKED
-
-#endif // Czech (Czech Republic) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-/////////////////////////////////////////////////////////////////////////////
-// English (United States) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
IDD_OmegleACCOUNT DIALOGEX 0, 0, 186, 134
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
EXSTYLE WS_EX_CONTROLPARENT
@@ -104,12 +101,14 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
COMBOBOX IDC_SERVER,60,0,125,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "Server:",IDC_STATIC,0,2,60,8
- LTEXT "Visible name:",IDC_STATIC,0,17,60,8
- EDITTEXT IDC_NAME,60,15,125,14,ES_AUTOHSCROLL
+ LTEXT "Visible name:",IDC_STATIC,0,32,60,8
+ EDITTEXT IDC_NAME,60,30,125,14,ES_AUTOHSCROLL
CONTROL "Meet strangers with common interests",IDC_MEET_COMMON,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,0,36,185,10
- EDITTEXT IDC_INTERESTS,0,60,185,32,ES_MULTILINE | ES_AUTOVSCROLL | WS_VSCROLL
- LTEXT "Your interests (separated by commas):",IDC_STATIC,0,50,185,8
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,0,52,185,10
+ EDITTEXT IDC_INTERESTS,0,76,185,32,ES_MULTILINE | ES_AUTOVSCROLL | WS_VSCROLL
+ LTEXT "Your interests (separated by commas):",IDC_STATIC,0,66,185,8
+ COMBOBOX IDC_LANGUAGE,60,15,125,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Language:",IDC_STATIC,0,17,60,8
END
@@ -126,82 +125,22 @@ BEGIN
VERTGUIDE, 60
VERTGUIDE, 185
END
-END
-#endif // APSTUDIO_INVOKED
-
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE
-BEGIN
- "..\\src\\resource.h\0"
-END
-
-2 TEXTINCLUDE
-BEGIN
- "#include ""afxres.h""\r\n"
- "#include ""..\\src\\constants.h""\0"
-END
-
-3 TEXTINCLUDE
-BEGIN
- "\r\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDI_OMEGLE ICON "omegle.ico"
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 0,1,0,1
- PRODUCTVERSION 0,1,0,1
- FILEFLAGSMASK 0x17L
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x4L
- FILETYPE 0x2L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904b0"
- BEGIN
- VALUE "FileDescription", "Omegle protocol plugin for Miranda NG"
- VALUE "FileVersion", "0.1.1.0"
- VALUE "InternalName", "Omegle"
- VALUE "LegalCopyright", "Copyright © 2011-12 Robert Pösel"
- VALUE "OriginalFilename", "omegle.dll"
- VALUE "ProductName", "Omegle Protocol"
- VALUE "ProductVersion", "0.1.1.0"
- END
- END
- BLOCK "VarFileInfo"
+ IDD_OPTIONS, DIALOG
BEGIN
- VALUE "Translation", 0x409, 1200
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 309
+ VERTGUIDE, 24
+ VERTGUIDE, 84
+ VERTGUIDE, 214
+ VERTGUIDE, 296
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 241
END
END
+#endif // APSTUDIO_INVOKED
-#endif // English (United States) resources
+#endif // Czech (Czech Republic) resources
/////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/Omegle/res/version.rc b/protocols/Omegle/res/version.rc
new file mode 100644
index 0000000000..5bfbab4754
--- /dev/null
+++ b/protocols/Omegle/res/version.rc
@@ -0,0 +1,38 @@
+// Microsoft Visual C++ generated resource script.
+//
+#ifdef APSTUDIO_INVOKED
+#error this file is not editable by Microsoft Visual C++
+#endif //APSTUDIO_INVOKED
+
+#include "afxres.h"
+#include "..\src\version.h"
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION __FILEVERSION_STRING
+ PRODUCTVERSION __FILEVERSION_STRING
+ FILEFLAGSMASK 0x17L
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x0L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "000004b0"
+ BEGIN
+ VALUE "FileDescription", __DESCRIPTION
+ VALUE "InternalName", __PLUGIN_NAME
+ VALUE "LegalCopyright", __COPYRIGHT
+ VALUE "OriginalFilename", __FILENAME
+ VALUE "ProductName", __PLUGIN_NAME
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x0, 1200
+ END
+END
diff --git a/protocols/Omegle/src/chat.cpp b/protocols/Omegle/src/chat.cpp
index 647f012b40..62a00d5174 100644
--- a/protocols/Omegle/src/chat.cpp
+++ b/protocols/Omegle/src/chat.cpp
@@ -3,7 +3,7 @@
Omegle plugin for Miranda Instant Messenger
_____________________________________________
-Copyright © 2011-12 Robert Pösel
+Copyright © 2011-13 Robert Pösel
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -172,11 +172,9 @@ int OmegleProto::OnChatEvent(WPARAM wParam,LPARAM lParam)
break;
}
- }
+ } else switch (facy.state_) {
+ // Outgoing message
- // Outgoing message
- switch (facy.state_)
- {
case STATE_ACTIVE:
LOG("**Chat - Outgoing message: %s", text.c_str());
ForkThread(&OmegleProto::SendMsgWorker, this, (void*)new std::string(text));
@@ -402,4 +400,29 @@ void OmegleProto::ClearChat()
gce.pDest = &gcd;
CallServiceSync(MS_GC_EVENT,WINDOW_CLEARLOG,reinterpret_cast<LPARAM>(&gce));
+}
+
+// TODO: Could this be done better?
+HANDLE OmegleProto::GetChatHandle()
+{
+ /*if (facy.chatHandle_ != NULL)
+ return facy.chatHandle_;
+
+ for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ if (db_get_b(hContact, m_szModuleName, "ChatRoom", 0) > 0) {
+ ptrA id = db_get_sa(hContact, m_szModuleName, "ChatRoomId");
+ if (id != NULL && !strcmp(id, m_szModuleName))
+ return hContact;
+ }
+ }
+
+ return NULL;*/
+
+ GC_INFO gci = {0};
+ gci.Flags = HCONTACT;
+ gci.pszModule = m_szModuleName;
+ gci.pszID = const_cast<TCHAR*>(m_tszUserName);
+ CallService(MS_GC_GETINFO, 0, (LPARAM)(GC_INFO *) &gci);
+
+ return gci.hContact;
} \ No newline at end of file
diff --git a/protocols/Omegle/src/client.h b/protocols/Omegle/src/client.h
index be5ec9055c..a6e28c5a2c 100644
--- a/protocols/Omegle/src/client.h
+++ b/protocols/Omegle/src/client.h
@@ -3,7 +3,7 @@
Omegle plugin for Miranda Instant Messenger
_____________________________________________
-Copyright © 2011-12 Robert Pösel
+Copyright © 2011-13 Robert Pösel
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -48,11 +48,13 @@ public:
hConnection = NULL;
hEventsConnection = NULL;
connection_lock_ = NULL;
+ chatHandle_ = NULL;
}
HANDLE hConnection;
HANDLE hEventsConnection;
HANDLE connection_lock_;
+ HANDLE chatHandle_;
// Parent handle
OmegleProto* parent;
@@ -77,6 +79,7 @@ public:
void store_headers( http::response* resp, NETLIBHTTPHEADER* headers, int headers_count );
std::string get_server( bool not_last = false );
+ std::string get_language();
// Connection handling
unsigned int error_count_;
diff --git a/protocols/Omegle/src/common.h b/protocols/Omegle/src/common.h
index 76ca316359..3fdc0ab188 100644
--- a/protocols/Omegle/src/common.h
+++ b/protocols/Omegle/src/common.h
@@ -3,7 +3,7 @@
Omegle plugin for Miranda Instant Messenger
_____________________________________________
-Copyright © 2011-12 Robert Pösel
+Copyright © 2011-13 Robert Pösel
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -61,8 +61,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <m_icolib.h>
#include <m_utils.h>
#include <m_hotkeys.h>
+#include <m_message.h>
//#include <m_msg_buttonsbar.h>
+#include "version.h"
+
class OmegleProto;
#define LOG Log
diff --git a/protocols/Omegle/src/communication.cpp b/protocols/Omegle/src/communication.cpp
index fa34f586b8..033068b872 100644
--- a/protocols/Omegle/src/communication.cpp
+++ b/protocols/Omegle/src/communication.cpp
@@ -3,7 +3,7 @@
Omegle plugin for Miranda Instant Messenger
_____________________________________________
-Copyright © 2011-12 Robert Pösel
+Copyright © 2011-13 Robert Pösel
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -150,6 +150,15 @@ std::string Omegle_client::get_server( bool not_last )
return servers[server];
}
+std::string Omegle_client::get_language()
+{
+ BYTE language = db_get_b(NULL, parent->m_szModuleName, OMEGLE_KEY_LANGUAGE, 0);
+ if (language < 0 || language >= (SIZEOF(languages)))
+ language = 0;
+
+ return language > 0 ? languages[language].id : "en";
+}
+
int Omegle_client::choose_method( int request_type )
{
switch ( request_type )
@@ -198,7 +207,8 @@ std::string Omegle_client::choose_action( int request_type, std::string* data, s
{
case OMEGLE_REQUEST_START:
{
- std::string action = "/start?rcs=1&spid=";
+ std::string action = "/start?rcs=1&spid=&lang=";
+ action += get_language();
if (get_data != NULL)
action += (*get_data);
@@ -319,8 +329,8 @@ bool Omegle_client::start()
std::string data;
if (this->spy_mode_) {
- // get last server from list, which is for spy mode
- this->server_ = servers[SIZEOF(servers)-1];
+ //// get last server from list, which is for spy mode
+ //this->server_ = servers[SIZEOF(servers)-1];
if (this->question_.empty()) {
data = "&wantsspy=1";
@@ -371,8 +381,8 @@ bool Omegle_client::start()
data = "&topics=" + utils::url::encode(data);
}
- // get any server but last, which is for spy mode
- this->server_ = get_server(true);
+ //// get any server but last, which is for spy mode
+ //this->server_ = get_server(true);
}
}
@@ -508,6 +518,16 @@ bool Omegle_client::events( )
mir_free(msg);
}*/
+ if ( (pos = resp.data.find( "[\"serverMessage\", \"" )) != std::string::npos ) {
+ // We got server message
+ pos += 19;
+
+ std::string message = utils::text::trim( resp.data.substr(pos, resp.data.find("\"]", pos) - pos));
+ TCHAR *tstr = Langpack_PcharToTchar(message.c_str());
+ parent->UpdateChat(NULL, tstr);
+ mir_free(tstr);
+ }
+
if ( resp.data.find( "[\"connected\"]" ) != std::string::npos ) {
// Stranger connected
if (this->spy_mode_ && !this->question_.empty()) {
@@ -555,6 +575,7 @@ bool Omegle_client::events( )
{
// Stranger is typing, not supported by chat module yet
SkinPlaySound( "StrangerTyp" );
+ CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)parent->GetChatHandle(), (LPARAM)TranslateT("Stranger is typing."));
}
if ( resp.data.find( "[\"stoppedTyping\"]" ) != std::string::npos
@@ -562,6 +583,7 @@ bool Omegle_client::events( )
{
// Stranger stopped typing, not supported by chat module yet
SkinPlaySound( "StrangerTypStop" );
+ CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)parent->GetChatHandle(), (LPARAM)TranslateT("Stranger stopped typing."));
}
pos = 0;
@@ -577,6 +599,8 @@ bool Omegle_client::events( )
TCHAR *msg = mir_a2t_cp(message.c_str(),CP_UTF8);
parent->UpdateChat(TranslateT("Stranger"), msg);
mir_free(msg);
+
+ CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)parent->GetChatHandle(), 0);
}
}
diff --git a/protocols/Omegle/src/connection.cpp b/protocols/Omegle/src/connection.cpp
index 409b376a33..b098e81fad 100644
--- a/protocols/Omegle/src/connection.cpp
+++ b/protocols/Omegle/src/connection.cpp
@@ -3,7 +3,7 @@
Omegle plugin for Miranda Instant Messenger
_____________________________________________
-Copyright © 2011-12 Robert Pösel
+Copyright © 2011-13 Robert Pösel
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/protocols/Omegle/src/constants.h b/protocols/Omegle/src/constants.h
index 319c184992..81a4630c98 100644
--- a/protocols/Omegle/src/constants.h
+++ b/protocols/Omegle/src/constants.h
@@ -3,7 +3,7 @@
Omegle plugin for Miranda Instant Messenger
_____________________________________________
-Copyright © 2011-12 Robert Pösel
+Copyright © 2011-13 Robert Pösel
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,10 +22,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
-// Version management
-#define __VERSION_DWORD PLUGIN_MAKE_VERSION(0,1,1,0)
-#define __VERSION_STRING "0.1.1.0"
-
// Product management
#define OMEGLE_NAME "Omegle"
#define OMEGLE_SERVER_REGULAR "http://www.omegle.com"
@@ -52,4 +48,88 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// Servers list
//static const char *servers[] = {"Random", "bajor", "cardassia", "promenade", "odo-bucket", "ferengi", "quilt", "empok-nor", "quibbler"};
-static const char *servers[] = {"Random", "front1", "front2", "front3", "front4", "qfront1"}; \ No newline at end of file
+static const char *servers[] = {"Random", "front1", "front2", "front3", "front4", "front5", "front6", "front7", "front8", "front9"};
+
+static const struct {
+ const char *id;
+ const char *lang;
+} languages[] = {
+ {"en", "English"},
+ {"af", "Afrikaans"},
+ {"sq", "Albanian"},
+ {"ar", "Arabic"},
+ {"hy", "Armenian"},
+ {"az", "Azerbaijani"},
+ {"eu", "Basque"},
+ {"be", "Belarusian"},
+ {"bn", "Bengali"},
+ {"bs", "Bosnian"},
+ {"bg", "Bulgarian"},
+ {"ceb", "Cebuanese"},
+ {"cs", "Czech"},
+ {"zh-CN", "Chinese (simplified)"},
+ {"zh-TW", "Chinese (traditional)"},
+ {"da", "Danish"},
+ {"eo", "Esperanto"},
+ {"et", "Estonian"},
+ {"tl", "Philipino"},
+ {"fi", "Finnish"},
+ {"fr", "French"},
+ {"gl", "Galician"},
+ {"ka", "Georgian"},
+ {"gu", "Gujarati"},
+ {"ht", "Haitian Creole"},
+ {"iw", "Hebrew"},
+ {"hi", "Hindi"},
+ {"hmn", "Hmong"},
+ {"nl", "Dutch"},
+ {"hr", "Croat"},
+ {"id", "Indonesian"},
+ {"ga", "Irish"},
+ {"is", "Icelandic"},
+ {"it", "Italian"},
+ {"ja", "Japanese"},
+ {"jw", "Javanese"},
+ {"yi", "Yiddish"},
+ {"kn", "Kannada"},
+ {"ca", "Catalan"},
+ {"km", "Khmer"},
+ {"ko", "Korean"},
+ {"lo", "Lao"},
+ {"la", "Latina"},
+ {"lt", "Lithuanian"},
+ {"lv", "Latvian"},
+ {"hu", "Hungarian"},
+ {"mk", "Macedonian"},
+ {"ms", "Malay"},
+ {"mt", "Maltese"},
+ {"mr", "Marathi"},
+ {"de", "German"},
+ {"no", "Norwegian"},
+ {"fa", "Persian"},
+ {"pl", "Polish"},
+ {"pt", "Portugese"},
+ {"ro", "Romañian"},
+ {"ru", "Russian"},
+ {"el", "Greek"},
+ {"sk", "Slovak"},
+ {"sl", "Slovenian"},
+ {"sr", "Serbian"},
+ {"sw", "Swahili"},
+ {"es", "Spanish"},
+ {"sv", "Swedish"},
+ {"ta", "Tamil"},
+ {"te", "Telugu"},
+ {"th", "Thai"},
+ {"tr", "Turkish"},
+ {"uk", "Ukrainian"},
+ {"ur", "Urdu"},
+ {"cy", "Welsh"},
+ {"vi", "Vietnamese"}
+};
+
+// Known server messages, only to inform lpgen
+static const char *server_messages[] = {
+ LPGEN("Stranger is using Omegle's mobile Web site (omegle.com on a phone or tablet)"),
+ LPGEN("You and stranger speak the same language.")
+};
diff --git a/protocols/Omegle/src/db.h b/protocols/Omegle/src/db.h
index 355c0061ab..69dfa7e54e 100644
--- a/protocols/Omegle/src/db.h
+++ b/protocols/Omegle/src/db.h
@@ -3,7 +3,7 @@
Omegle plugin for Miranda Instant Messenger
_____________________________________________
-Copyright © 2011-12 Robert Pösel
+Copyright © 2011-13 Robert Pösel
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -50,6 +50,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define OMEGLE_KEY_INTERESTS "Interests"
#define OMEGLE_KEY_REUSE_QUESTION "ReuseQuestion"
#define OMEGLE_KEY_SERVER "Server"
+#define OMEGLE_KEY_LANGUAGE "Language"
#define OMEGLE_KEY_LOGGING "EnableLogging"
#define OMEGLE_KEY_SERVER_INFO "GetServerInfo"
#define OMEGLE_KEY_LAST_QUESTION "LastQuestion"
diff --git a/protocols/Omegle/src/dialogs.cpp b/protocols/Omegle/src/dialogs.cpp
index a3dff58abc..057a43955f 100644
--- a/protocols/Omegle/src/dialogs.cpp
+++ b/protocols/Omegle/src/dialogs.cpp
@@ -3,7 +3,7 @@
Omegle plugin for Miranda Instant Messenger
_____________________________________________
-Copyright © 2011-12 Robert Pösel
+Copyright © 2011-13 Robert Pösel
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -77,11 +77,14 @@ INT_PTR CALLBACK OmegleAccountProc( HWND hwnd, UINT message, WPARAM wparam, LPAR
// Server
SendDlgItemMessageA(hwnd, IDC_SERVER, CB_INSERTSTRING, 0, reinterpret_cast<LPARAM>(Translate(servers[0])));
for(size_t i=1; i<SIZEOF(servers); i++)
- {
SendDlgItemMessageA(hwnd, IDC_SERVER, CB_INSERTSTRING, i, reinterpret_cast<LPARAM>(servers[i]));
- }
SendDlgItemMessage(hwnd, IDC_SERVER, CB_SETCURSEL, db_get_b(NULL, proto->m_szModuleName, OMEGLE_KEY_SERVER, 0), 0);
+ // Language
+ for(size_t i=0; i<SIZEOF(languages); i++)
+ SendDlgItemMessageA(hwnd, IDC_LANGUAGE, CB_INSERTSTRING, i, reinterpret_cast<LPARAM>(Translate(languages[i].lang)));
+ SendDlgItemMessage(hwnd, IDC_LANGUAGE, CB_SETCURSEL, db_get_b(NULL, proto->m_szModuleName, OMEGLE_KEY_LANGUAGE, 0), 0);
+
LoadDBText(proto, hwnd, IDC_NAME, OMEGLE_KEY_NAME);
LoadDBText(proto, hwnd, IDC_INTERESTS, OMEGLE_KEY_INTERESTS);
LoadDBCheckState(proto, hwnd, IDC_MEET_COMMON, OMEGLE_KEY_MEET_COMMON);
@@ -91,6 +94,7 @@ INT_PTR CALLBACK OmegleAccountProc( HWND hwnd, UINT message, WPARAM wparam, LPAR
case WM_COMMAND:
switch(LOWORD(wparam))
{
+ case IDC_LANGUAGE:
case IDC_SERVER:
if (HIWORD(wparam) == CBN_SELCHANGE) {
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
@@ -115,6 +119,7 @@ INT_PTR CALLBACK OmegleAccountProc( HWND hwnd, UINT message, WPARAM wparam, LPAR
proto = reinterpret_cast<OmegleProto*>(GetWindowLongPtr(hwnd,GWLP_USERDATA));
db_set_b(NULL, proto->m_szModuleName, OMEGLE_KEY_SERVER, SendDlgItemMessage(hwnd, IDC_SERVER, CB_GETCURSEL, 0, 0));
+ db_set_b(NULL, proto->m_szModuleName, OMEGLE_KEY_LANGUAGE, SendDlgItemMessage(hwnd, IDC_LANGUAGE, CB_GETCURSEL, 0, 0));
StoreDBText(proto, hwnd, IDC_NAME, OMEGLE_KEY_NAME);
StoreDBText(proto, hwnd, IDC_INTERESTS, OMEGLE_KEY_INTERESTS);
@@ -149,11 +154,14 @@ INT_PTR CALLBACK OmegleOptionsProc( HWND hwnd, UINT message, WPARAM wparam, LPAR
// Server
SendDlgItemMessageA(hwnd, IDC_SERVER, CB_INSERTSTRING, 0, reinterpret_cast<LPARAM>(Translate(servers[0])));
for(size_t i=1; i<SIZEOF(servers); i++)
- {
SendDlgItemMessageA(hwnd, IDC_SERVER, CB_INSERTSTRING, i, reinterpret_cast<LPARAM>(servers[i]));
- }
SendDlgItemMessage(hwnd, IDC_SERVER, CB_SETCURSEL, db_get_b(NULL, proto->m_szModuleName, OMEGLE_KEY_SERVER, 0), 0);
+ // Language
+ for(size_t i=0; i<SIZEOF(languages); i++)
+ SendDlgItemMessageA(hwnd, IDC_LANGUAGE, CB_INSERTSTRING, i, reinterpret_cast<LPARAM>(Translate(languages[i].lang)));
+ SendDlgItemMessage(hwnd, IDC_LANGUAGE, CB_SETCURSEL, db_get_b(NULL, proto->m_szModuleName, OMEGLE_KEY_LANGUAGE, 0), 0);
+
LoadDBText(proto, hwnd, IDC_NAME, OMEGLE_KEY_NAME);
LoadDBText(proto, hwnd, IDC_INTERESTS, OMEGLE_KEY_INTERESTS);
LoadDBText(proto, hwnd, IDC_HI_MESSAGE, OMEGLE_KEY_HI);
@@ -175,7 +183,8 @@ INT_PTR CALLBACK OmegleOptionsProc( HWND hwnd, UINT message, WPARAM wparam, LPAR
switch(LOWORD(wparam))
{
- case IDC_SERVER:
+ case IDC_SERVER:
+ case IDC_LANGUAGE:
if (HIWORD(wparam) == CBN_SELCHANGE) {
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
} break;
@@ -209,6 +218,7 @@ INT_PTR CALLBACK OmegleOptionsProc( HWND hwnd, UINT message, WPARAM wparam, LPAR
proto = reinterpret_cast<OmegleProto*>(GetWindowLongPtr(hwnd,GWLP_USERDATA));
db_set_b(NULL, proto->m_szModuleName, OMEGLE_KEY_SERVER, SendDlgItemMessage(hwnd, IDC_SERVER, CB_GETCURSEL, 0, 0));
+ db_set_b(NULL, proto->m_szModuleName, OMEGLE_KEY_LANGUAGE, SendDlgItemMessage(hwnd, IDC_LANGUAGE, CB_GETCURSEL, 0, 0));
StoreDBText(proto, hwnd, IDC_NAME, OMEGLE_KEY_NAME);
StoreDBText(proto, hwnd, IDC_INTERESTS, OMEGLE_KEY_INTERESTS);
diff --git a/protocols/Omegle/src/dialogs.h b/protocols/Omegle/src/dialogs.h
index 880f04636b..e28e6a7134 100644
--- a/protocols/Omegle/src/dialogs.h
+++ b/protocols/Omegle/src/dialogs.h
@@ -3,7 +3,7 @@
Omegle plugin for Miranda Instant Messenger
_____________________________________________
-Copyright © 2011-12 Robert Pösel
+Copyright © 2011-13 Robert Pösel
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/protocols/Omegle/src/events.cpp b/protocols/Omegle/src/events.cpp
index 5e2749e70c..b5f29b13ef 100644
--- a/protocols/Omegle/src/events.cpp
+++ b/protocols/Omegle/src/events.cpp
@@ -3,7 +3,7 @@
Omegle plugin for Miranda Instant Messenger
_____________________________________________
-Copyright © 2011-12 Robert Pösel
+Copyright © 2011-13 Robert Pösel
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/protocols/Omegle/src/http.cpp b/protocols/Omegle/src/http.cpp
index e360253e1a..159f55365b 100644
--- a/protocols/Omegle/src/http.cpp
+++ b/protocols/Omegle/src/http.cpp
@@ -3,7 +3,7 @@
Omegle plugin for Miranda Instant Messenger
_____________________________________________
-Copyright © 2011-12 Robert Pösel
+Copyright © 2011-13 Robert Pösel
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/protocols/Omegle/src/http.h b/protocols/Omegle/src/http.h
index a09e4f903d..451fe78458 100644
--- a/protocols/Omegle/src/http.h
+++ b/protocols/Omegle/src/http.h
@@ -3,7 +3,7 @@
Omegle plugin for Miranda Instant Messenger
_____________________________________________
-Copyright © 2011-12 Robert Pösel
+Copyright © 2011-13 Robert Pösel
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/protocols/Omegle/src/main.cpp b/protocols/Omegle/src/main.cpp
index 04d22d4711..497717ab98 100644
--- a/protocols/Omegle/src/main.cpp
+++ b/protocols/Omegle/src/main.cpp
@@ -3,7 +3,7 @@
Omegle plugin for Miranda Instant Messenger
_____________________________________________
-Copyright © 2011-12 Robert Pösel
+Copyright © 2011-13 Robert Pösel
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -33,13 +33,13 @@ DWORD g_mirandaVersion;
PLUGININFOEX pluginInfo = {
sizeof(PLUGININFOEX),
- "Omegle Protocol",
- __VERSION_DWORD,
- "Omegle protocol support for Miranda NG.",
- "Robert P\xf6" "sel",
- "robyer@seznam.cz",
- "(c) 2011-12 Robert P\xf6" "sel",
- "http://miranda-ng.org/",
+ __PLUGIN_NAME,
+ PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
+ __DESCRIPTION,
+ __AUTHOR,
+ __AUTHOREMAIL,
+ __COPYRIGHT,
+ __AUTHORWEB,
UNICODE_AWARE,
// {9E1D9244-606C-4ef4-99A0-1D7D23CB7601}
{ 0x9e1d9244, 0x606c, 0x4ef4, { 0x99, 0xa0, 0x1d, 0x7d, 0x23, 0xcb, 0x76, 0x1 } }
diff --git a/protocols/Omegle/src/messages.cpp b/protocols/Omegle/src/messages.cpp
index b90ff67579..90049ab2cd 100644
--- a/protocols/Omegle/src/messages.cpp
+++ b/protocols/Omegle/src/messages.cpp
@@ -3,7 +3,7 @@
Omegle plugin for Miranda Instant Messenger
_____________________________________________
-Copyright © 2011-12 Robert Pösel
+Copyright © 2011-13 Robert Pösel
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/protocols/Omegle/src/process.cpp b/protocols/Omegle/src/process.cpp
index eb707373ec..cac7c8ef91 100644
--- a/protocols/Omegle/src/process.cpp
+++ b/protocols/Omegle/src/process.cpp
@@ -3,7 +3,7 @@
Omegle plugin for Miranda Instant Messenger
_____________________________________________
-Copyright © 2011-12 Robert Pösel
+Copyright © 2011-13 Robert Pösel
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/protocols/Omegle/src/proto.cpp b/protocols/Omegle/src/proto.cpp
index ad5229f13d..09f330a111 100644
--- a/protocols/Omegle/src/proto.cpp
+++ b/protocols/Omegle/src/proto.cpp
@@ -3,7 +3,7 @@
Omegle plugin for Miranda Instant Messenger
_____________________________________________
-Copyright © 2011-12 Robert Pösel
+Copyright © 2011-13 Robert Pösel
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/protocols/Omegle/src/proto.h b/protocols/Omegle/src/proto.h
index 001e148735..6af449a453 100644
--- a/protocols/Omegle/src/proto.h
+++ b/protocols/Omegle/src/proto.h
@@ -3,7 +3,7 @@
Omegle plugin for Miranda Instant Messenger
_____________________________________________
-Copyright © 2011-12 Robert Pösel
+Copyright © 2011-13 Robert Pösel
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -132,6 +132,7 @@ public:
void SetChatStatus(int);
void ClearChat();
void SetTopic(const TCHAR *topic = NULL);
+ HANDLE GetChatHandle();
// Connection client
Omegle_client facy;
diff --git a/protocols/Omegle/src/resource.h b/protocols/Omegle/src/resource.h
index cc7a7d5af1..e34fac5b93 100644
--- a/protocols/Omegle/src/resource.h
+++ b/protocols/Omegle/src/resource.h
@@ -1,6 +1,6 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
-// Used by omegle.rc
+// Used by D:\Development\Miranda NG\protocols\Omegle\res\omegle.rc
//
#define IDI_OMEGLE 101
#define IDD_OmegleACCOUNT 111
@@ -10,9 +10,11 @@
#define IDC_MEET_COMMON 1206
#define IDC_INTERESTS 1207
#define IDC_HI_ENABLED 1208
+#define IDC_SERVER2 1208
#define IDC_HI_MESSAGE 1209
#define IDC_ASL_MESSAGE 1210
#define IDC_LAST_QUESTION 1211
+#define IDC_LANGUAGE 1212
#define IDC_NOCLEAR 1213
#define IDC_DONTSTOP 1214
#define IDC_REUSE_QUESTIONS 1215
diff --git a/protocols/Omegle/src/stubs.cpp b/protocols/Omegle/src/stubs.cpp
index b02fd71ef5..9d30932504 100644
--- a/protocols/Omegle/src/stubs.cpp
+++ b/protocols/Omegle/src/stubs.cpp
@@ -3,7 +3,7 @@
Omegle plugin for Miranda Instant Messenger
_____________________________________________
-Copyright © 2011-12 Robert Pösel
+Copyright © 2011-13 Robert Pösel
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/protocols/Omegle/src/theme.cpp b/protocols/Omegle/src/theme.cpp
index 202d58791e..786e2c2340 100644
--- a/protocols/Omegle/src/theme.cpp
+++ b/protocols/Omegle/src/theme.cpp
@@ -3,7 +3,7 @@
Omegle plugin for Miranda Instant Messenger
_____________________________________________
-Copyright © 2011-12 Robert Pösel
+Copyright © 2011-13 Robert Pösel
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/protocols/Omegle/src/theme.h b/protocols/Omegle/src/theme.h
index 7456803b6c..302b0e296d 100644
--- a/protocols/Omegle/src/theme.h
+++ b/protocols/Omegle/src/theme.h
@@ -3,7 +3,7 @@
Omegle plugin for Miranda Instant Messenger
_____________________________________________
-Copyright © 2011-12 Robert Pösel
+Copyright © 2011-13 Robert Pösel
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/protocols/Omegle/src/utils.cpp b/protocols/Omegle/src/utils.cpp
index d8c5837cb0..fcc45aa502 100644
--- a/protocols/Omegle/src/utils.cpp
+++ b/protocols/Omegle/src/utils.cpp
@@ -3,7 +3,7 @@
Omegle plugin for Miranda Instant Messenger
_____________________________________________
-Copyright © 2011-12 Robert Pösel
+Copyright © 2011-13 Robert Pösel
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/protocols/Omegle/src/utils.h b/protocols/Omegle/src/utils.h
index 908b721e72..d6b8e560eb 100644
--- a/protocols/Omegle/src/utils.h
+++ b/protocols/Omegle/src/utils.h
@@ -3,7 +3,7 @@
Omegle plugin for Miranda Instant Messenger
_____________________________________________
-Copyright © 2011-12 Robert Pösel
+Copyright © 2011-13 Robert Pösel
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/protocols/Omegle/src/version.h b/protocols/Omegle/src/version.h
new file mode 100644
index 0000000000..f8f8b70911
--- /dev/null
+++ b/protocols/Omegle/src/version.h
@@ -0,0 +1,21 @@
+#define __MAJOR_VERSION 0
+#define __MINOR_VERSION 1
+#define __RELEASE_NUM 2
+#define __BUILD_NUM 0
+
+#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
+#define __FILEVERSION_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM
+
+#define __STRINGIFY_IMPL(x) #x
+#define __STRINGIFY(x) __STRINGIFY_IMPL(x)
+#define __VERSION_STRING __STRINGIFY(__FILEVERSION_DOTS)
+
+#define __PLUGIN_NAME "Omegle Protocol"
+#define __INTERNAL_NAME "Omegle Protocol"
+#define __FILENAME "Omegle.dll"
+#define __DESCRIPTION "Omegle protocol support for Miranda NG."
+#define __AUTHOR "Robert P\xf6" "sel"
+#define __AUTHOREMAIL "robyer@seznam.cz"
+#define __AUTHORWEB "http://miranda-ng.org/"
+#define __COPYRIGHT "© 2011-13 Robert P\xf6" "sel"
+