summaryrefslogtreecommitdiff
path: root/protocols/IRCG
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-05-21 16:11:58 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-05-21 16:11:58 +0000
commit48266e479d1fcf5153b29c612866845990fccad8 (patch)
treec8cbc908cd3c5f08731e5e8d7eaac6b568007d09 /protocols/IRCG
parentebdb556f152734035846f120eb8112f88ef91281 (diff)
war against atavisms continues
- everything that goes to PSS_MESSAGE should be sent as utf8 string; - thus PREF_UNICODE & PREF_UTF support discontinued, these constants are removed; - support for PREF_UNICODE & PREF_UTF in protocols also removed; - PREF_UNICODE used in file transfers (PROTOFILERECVT) replaced with PRFF_UNICODE / PRFF_TCHAR git-svn-id: http://svn.miranda-ng.org/main/trunk@13734 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IRCG')
-rw-r--r--protocols/IRCG/src/commandmonitor.cpp5
-rw-r--r--protocols/IRCG/src/ircproto.cpp20
2 files changed, 6 insertions, 19 deletions
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp
index c6dbac79e0..824588b369 100644
--- a/protocols/IRCG/src/commandmonitor.cpp
+++ b/protocols/IRCG/src/commandmonitor.cpp
@@ -705,7 +705,6 @@ bool CIrcProto::OnIrc_PRIVMSG(const CIrcMessage* pmsg)
PROTORECVEVENT pre = { 0 };
pre.timestamp = (DWORD)time(NULL);
- pre.flags = PREF_UTF;
pre.szMessage = mir_utf8encodeW(mess.c_str());
setTString(hContact, "User", pmsg->prefix.sUser.c_str());
setTString(hContact, "Host", pmsg->prefix.sHost.c_str());
@@ -1162,7 +1161,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
TCHAR* tszTemp = (TCHAR*)sFile.c_str();
PROTORECVFILET pre = { 0 };
- pre.flags = PREF_TCHAR;
+ pre.dwFlags = PRFF_TCHAR;
pre.timestamp = (DWORD)time(NULL);
pre.fileCount = 1;
pre.ptszFiles = &tszTemp;
@@ -2284,7 +2283,7 @@ void CIrcProto::OnIrcDisconnected()
m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE;
ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)Temp, ID_STATUS_OFFLINE);
- CMString sDisconn = _T("\0035\002");
+ CMString sDisconn = _T("\035\002");
sDisconn += TranslateT("*Disconnected*");
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, sDisconn.c_str(), NULL, NULL, NULL, true, false);
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp
index c70e78ab11..162876aeca 100644
--- a/protocols/IRCG/src/ircproto.cpp
+++ b/protocols/IRCG/src/ircproto.cpp
@@ -460,7 +460,7 @@ DWORD_PTR __cdecl CIrcProto::GetCaps(int type, MCONTACT)
return PF2_SHORTAWAY;
case PFLAGNUM_4:
- return PF4_NOAUTHDENYREASON | PF4_NOCUSTOMAUTH | PF4_IMSENDUTF;
+ return PF4_NOAUTHDENYREASON | PF4_NOCUSTOMAUTH;
case PFLAG_UNIQUEIDTEXT:
return (DWORD_PTR)Translate("Nickname");
@@ -678,7 +678,7 @@ void __cdecl CIrcProto::AckMessageSuccess(void *info)
delete param;
}
-int __cdecl CIrcProto::SendMsg(MCONTACT hContact, int flags, const char* pszSrc)
+int __cdecl CIrcProto::SendMsg(MCONTACT hContact, int, const char* pszSrc)
{
BYTE bDcc = getByte(hContact, "DCC", 0);
WORD wStatus = getWord(hContact, "Status", ID_STATUS_OFFLINE);
@@ -686,6 +686,7 @@ int __cdecl CIrcProto::SendMsg(MCONTACT hContact, int flags, const char* pszSrc)
ForkThread(&CIrcProto::AckMessageFailDcc, (void*)hContact);
return 0;
}
+
if (!bDcc && (m_iStatus == ID_STATUS_OFFLINE || m_iStatus == ID_STATUS_CONNECTING)) {
ForkThread(&CIrcProto::AckMessageFail, (void*)hContact);
return 0;
@@ -694,20 +695,7 @@ int __cdecl CIrcProto::SendMsg(MCONTACT hContact, int flags, const char* pszSrc)
int codepage = getCodepage();
TCHAR *result;
- if (flags & PREF_UNICODE) {
- const char* p = strchr(pszSrc, '\0');
- if (p != pszSrc) {
- while (*(++p) == '\0')
- ;
- result = mir_u2t_cp((wchar_t*)p, codepage);
- }
- else result = mir_a2t_cp(pszSrc, codepage);
- }
- else if (flags & PREF_UTF)
- mir_utf8decode(NEWSTR_ALLOCA(pszSrc), &result);
- else
- result = mir_a2t_cp(pszSrc, codepage);
-
+ mir_utf8decode(NEWSTR_ALLOCA(pszSrc), &result);
PostIrcMessageWnd(NULL, hContact, result);
mir_free(result);