summaryrefslogtreecommitdiff
path: root/protocols/Omegle/src
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Omegle/src')
-rw-r--r--protocols/Omegle/src/chat.cpp10
-rw-r--r--protocols/Omegle/src/client.h2
-rw-r--r--protocols/Omegle/src/communication.cpp36
-rw-r--r--protocols/Omegle/src/dialogs.cpp2
-rw-r--r--protocols/Omegle/src/main.cpp2
-rw-r--r--protocols/Omegle/src/messages.cpp2
-rw-r--r--protocols/Omegle/src/proto.cpp4
7 files changed, 29 insertions, 29 deletions
diff --git a/protocols/Omegle/src/chat.cpp b/protocols/Omegle/src/chat.cpp
index b3db982704..73fc40ea11 100644
--- a/protocols/Omegle/src/chat.cpp
+++ b/protocols/Omegle/src/chat.cpp
@@ -37,7 +37,7 @@ void OmegleProto::UpdateChat(const wchar_t *name, const wchar_t *message, bool a
name = TranslateT("Server");
gce.bIsMe = false;
}
- else gce.bIsMe = !mir_tstrcmp(name, this->facy.nick_);
+ else gce.bIsMe = !mir_wstrcmp(name, this->facy.nick_);
if (addtolog)
gce.dwFlags |= GCEF_ADDTOLOG;
@@ -58,7 +58,7 @@ int OmegleProto::OnChatEvent(WPARAM, LPARAM lParam)
{
case GC_USER_MESSAGE:
{
- std::string text = mir_t2a_cp(hook->ptszText, CP_UTF8);
+ std::string text = mir_u2a_cp(hook->ptszText, CP_UTF8);
// replace %% back to %, because chat automatically does this to sent messages
utils::text::replace_all(&text, "%%", "%");
@@ -238,7 +238,7 @@ void OmegleProto::AddChatContact(const wchar_t *name)
if (name == NULL)
gce.bIsMe = false;
else
- gce.bIsMe = mir_tstrcmp(name, this->facy.nick_);
+ gce.bIsMe = mir_wstrcmp(name, this->facy.nick_);
if (gce.bIsMe)
gce.ptszStatus = L"Admin";
@@ -259,7 +259,7 @@ void OmegleProto::DeleteChatContact(const wchar_t *name)
if (name == NULL)
gce.bIsMe = false;
else
- gce.bIsMe = mir_tstrcmp(name, this->facy.nick_);
+ gce.bIsMe = mir_wstrcmp(name, this->facy.nick_);
CallServiceSync(MS_GC_EVENT, 0, reinterpret_cast<LPARAM>(&gce));
}
@@ -333,7 +333,7 @@ void OmegleProto::SetChatStatus(int status)
// Load actual name from database
facy.nick_ = db_get_tsa(NULL, m_szModuleName, OMEGLE_KEY_NAME);
if (facy.nick_ == NULL) {
- facy.nick_ = mir_tstrdup(TranslateT("You"));
+ facy.nick_ = mir_wstrdup(TranslateT("You"));
db_set_ts(NULL, m_szModuleName, OMEGLE_KEY_NAME, facy.nick_);
}
diff --git a/protocols/Omegle/src/client.h b/protocols/Omegle/src/client.h
index 2aae2017a8..925132bb82 100644
--- a/protocols/Omegle/src/client.h
+++ b/protocols/Omegle/src/client.h
@@ -69,7 +69,7 @@ public:
std::string chat_id_;
std::string server_;
std::string question_;
- ptrT nick_;
+ ptrW nick_;
//int msgid_;
diff --git a/protocols/Omegle/src/communication.cpp b/protocols/Omegle/src/communication.cpp
index 27370cb1f4..0e3abe9354 100644
--- a/protocols/Omegle/src/communication.cpp
+++ b/protocols/Omegle/src/communication.cpp
@@ -365,7 +365,7 @@ bool Omegle_client::start()
char str[255];
mir_snprintf(str, Translate("Connected to server %s. There are %s users online now."), server_.c_str(), count.c_str());
- wchar_t *msg = mir_a2t(str);
+ wchar_t *msg = mir_a2u(str);
parent->UpdateChat(NULL, msg);
mir_free(msg);
}
@@ -374,7 +374,7 @@ bool Omegle_client::start()
char str[255];
mir_snprintf(str, Translate("Connected to server %s."), server_.c_str());
- wchar_t *msg = mir_a2t(str);
+ wchar_t *msg = mir_a2u(str);
parent->UpdateChat(NULL, msg);
mir_free(msg);
}
@@ -505,14 +505,14 @@ bool Omegle_client::events()
//data["timestamp"]; // e.g. 1445336566.0196209
// We got info about count of connected people there
- ptrT count(json_as_string(json_get(data, "count")));
+ ptrW count(json_as_string(json_get(data, "count")));
wchar_t strT[255];
- mir_sntprintf(strT, TranslateT("On whole Omegle are %s strangers online now."), count);
+ mir_snwprintf(strT, TranslateT("On whole Omegle are %s strangers online now."), count);
parent->UpdateChat(NULL, strT);
}
else if (name == "serverMessage") {
- ptrT message(json_as_string(json_at(item, 1)));
+ ptrW message(json_as_string(json_at(item, 1)));
parent->UpdateChat(NULL, TranslateTS(message));
}
else if (name == "connected") {
@@ -536,7 +536,7 @@ bool Omegle_client::events()
JSONNode *items = json_at(item, 1);
size_t size = json_size(items);
for (size_t i = 0; i < size; i++) {
- likes += ptrT(json_as_string(json_at(items, i)));
+ likes += ptrW(json_as_string(json_at(items, i)));
if (i < size - 1)
likes += L", ";
}
@@ -545,7 +545,7 @@ bool Omegle_client::events()
parent->SetTopic(likes.c_str());
}
else if (name == "question") {
- ptrT question(json_as_string(json_at(item, 1)));
+ ptrW question(json_as_string(json_at(item, 1)));
parent->SetTopic(question);
}
else if (name == "typing" || name == "spyTyping") {
@@ -556,8 +556,8 @@ bool Omegle_client::events()
st.cbSize = sizeof(st);
st.hIcon = IcoLib_GetIconByHandle(GetIconHandle("typing_on"));
- ptrT who(name == "spyTyping" ? json_as_string(json_at(item, 1)) : mir_tstrdup(L"Stranger"));
- mir_sntprintf(st.tszText, TranslateT("%s is typing."), TranslateTS(who));
+ ptrW who(name == "spyTyping" ? json_as_string(json_at(item, 1)) : mir_wstrdup(L"Stranger"));
+ mir_snwprintf(st.tszText, TranslateT("%s is typing."), TranslateTS(who));
CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)parent->GetChatHandle(), (LPARAM)&st);
}
@@ -569,8 +569,8 @@ bool Omegle_client::events()
st.cbSize = sizeof(st);
st.hIcon = IcoLib_GetIconByHandle(GetIconHandle("typing_off"));
- ptrT who(name == "spyTyping" ? json_as_string(json_at(item, 1)) : mir_tstrdup(L"Stranger"));
- mir_sntprintf(st.tszText, TranslateT("%s stopped typing."), TranslateTS(who));
+ ptrW who(name == "spyTyping" ? json_as_string(json_at(item, 1)) : mir_wstrdup(L"Stranger"));
+ mir_snwprintf(st.tszText, TranslateT("%s stopped typing."), TranslateTS(who));
CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)parent->GetChatHandle(), (LPARAM)&st);
}
@@ -581,7 +581,7 @@ bool Omegle_client::events()
SkinPlaySound("StrangerMessage");
if (state_ == STATE_ACTIVE) {
- ptrT msg(json_as_string(json_at(item, 1)));
+ ptrW msg(json_as_string(json_at(item, 1)));
parent->UpdateChat(TranslateT("Stranger"), msg);
}
}
@@ -592,8 +592,8 @@ bool Omegle_client::events()
SkinPlaySound("StrangerMessage");
if (state_ == STATE_SPY) {
- ptrT stranger(json_as_string(json_at(item, 1)));
- ptrT msg(json_as_string(json_at(item, 2)));
+ ptrW stranger(json_as_string(json_at(item, 1)));
+ ptrW msg(json_as_string(json_at(item, 2)));
parent->UpdateChat(stranger, msg);
}
}
@@ -612,10 +612,10 @@ bool Omegle_client::events()
else if (name == "spyDisconnected") {
CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)parent->GetChatHandle(), NULL);
- ptrT stranger(json_as_string(json_at(item, 1)));
+ ptrW stranger(json_as_string(json_at(item, 1)));
wchar_t strT[255];
- mir_sntprintf(strT, TranslateT("%s disconnected."), TranslateTS(stranger));
+ mir_snwprintf(strT, TranslateT("%s disconnected."), TranslateTS(stranger));
parent->UpdateChat(NULL, strT);
// Stranger disconnected
@@ -637,10 +637,10 @@ bool Omegle_client::events()
parent->StopChat(false);
}
else if (name == "error") {
- ptrT error(json_as_string(json_at(item, 1)));
+ ptrW error(json_as_string(json_at(item, 1)));
wchar_t strT[255];
- mir_sntprintf(strT, TranslateT("Error: %s"), TranslateTS(error));
+ mir_snwprintf(strT, TranslateT("Error: %s"), TranslateTS(error));
parent->UpdateChat(NULL, strT);
}
}
diff --git a/protocols/Omegle/src/dialogs.cpp b/protocols/Omegle/src/dialogs.cpp
index 9868c51c57..206f3af30e 100644
--- a/protocols/Omegle/src/dialogs.cpp
+++ b/protocols/Omegle/src/dialogs.cpp
@@ -38,7 +38,7 @@ static BOOL StoreDBCheckState(OmegleProto* ppro, HWND hwnd, int idCtrl, const ch
static void LoadDBText(OmegleProto* ppro, HWND hwnd, int idCtrl, const char* szSetting)
{
- ptrT tstr(db_get_tsa(NULL, ppro->m_szModuleName, szSetting));
+ ptrW tstr(db_get_tsa(NULL, ppro->m_szModuleName, szSetting));
if (tstr)
SetDlgItemText(hwnd, idCtrl, tstr);
}
diff --git a/protocols/Omegle/src/main.cpp b/protocols/Omegle/src/main.cpp
index 309d0fe897..f49306a5a5 100644
--- a/protocols/Omegle/src/main.cpp
+++ b/protocols/Omegle/src/main.cpp
@@ -49,7 +49,7 @@ PLUGININFOEX pluginInfo = {
// Protocol instances
static int compare_protos(const OmegleProto *p1, const OmegleProto *p2)
{
- return mir_tstrcmp(p1->m_tszUserName, p2->m_tszUserName);
+ return mir_wstrcmp(p1->m_tszUserName, p2->m_tszUserName);
}
OBJLIST<OmegleProto> g_Instances(1, compare_protos);
diff --git a/protocols/Omegle/src/messages.cpp b/protocols/Omegle/src/messages.cpp
index 2a8f16b95e..86eff3e5fd 100644
--- a/protocols/Omegle/src/messages.cpp
+++ b/protocols/Omegle/src/messages.cpp
@@ -34,7 +34,7 @@ void OmegleProto::SendMsgWorker(void *p)
if (facy.state_ == STATE_ACTIVE && data.length() && facy.send_message(data))
{
- wchar_t *msg = mir_a2t_cp(data.c_str(), CP_UTF8);
+ wchar_t *msg = mir_a2u_cp(data.c_str(), CP_UTF8);
UpdateChat(facy.nick_, msg);
mir_free(msg);
}
diff --git a/protocols/Omegle/src/proto.cpp b/protocols/Omegle/src/proto.cpp
index aff30158c6..ee0b34a616 100644
--- a/protocols/Omegle/src/proto.cpp
+++ b/protocols/Omegle/src/proto.cpp
@@ -46,12 +46,12 @@ PROTO<OmegleProto>(proto_name, username)
NETLIBUSER nlu = { sizeof(nlu) };
nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
nlu.szSettingsModule = m_szModuleName;
- mir_sntprintf(descr, TranslateT("%s server connection"), m_tszUserName);
+ mir_snwprintf(descr, TranslateT("%s server connection"), m_tszUserName);
nlu.ptszDescriptiveName = descr;
m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
if (m_hNetlibUser == NULL) {
wchar_t error[200];
- mir_sntprintf(error, TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
+ mir_snwprintf(error, TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
MessageBox(NULL, error, L"Miranda NG", MB_OK | MB_ICONERROR);
}