summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/delphi/m_protosvc.inc2
-rw-r--r--plugins/Actman/iac_inout.pas15
-rw-r--r--plugins/Watrack/proto/proto.pas12
3 files changed, 11 insertions, 18 deletions
diff --git a/include/delphi/m_protosvc.inc b/include/delphi/m_protosvc.inc
index 315e5222c9..4a7d8085fb 100644
--- a/include/delphi/m_protosvc.inc
+++ b/include/delphi/m_protosvc.inc
@@ -182,9 +182,7 @@ const
// for PSR_MESSAGE
PREF_CREATEREAD = 1; // create the database event with the 'read' flag set
- PREF_UNICODE = 2;
PREF_RTL = 4; // 0.5+ addition: support for right-to-left messages
- PREF_UTF = 8; // message is in utf-8 (0.7.0+)
PREF_SENT = 16; // message will be created with the DBEF_SENT flag
// for PS_FILERESUME
diff --git a/plugins/Actman/iac_inout.pas b/plugins/Actman/iac_inout.pas
index 42e36913ff..a9930797ab 100644
--- a/plugins/Actman/iac_inout.pas
+++ b/plugins/Actman/iac_inout.pas
@@ -44,7 +44,7 @@ const
const // V2
ACF2_TXT_FILE = $00000001;
-
+
type
tInOutAction = class(tBaseAction)
private
@@ -269,20 +269,17 @@ begin
if hContact=0 then exit;
p:=GetContactProtoAcc(hContact);
- cp:=DBReadDWord(hContact,'Tab_SRMsg','ANSIcodepage',MirandaCP);
if DBReadByte(hContact,p,'ChatRoom',0)<>1 then
begin
- i:=WideToCombo(last,blob,cp);
-// if CallContactService(hContact,PSS_MESSAGEW,0,TLPARAM(blob))=
-// ACKRESULT_FAILED then
- CallContactService(hContact,PSS_MESSAGE,PREF_UNICODE,tlparam(blob));
+ WidetoUTF8(last,blob);
+ CallContactService(hContact,PSS_MESSAGE,0,tlparam(blob));
dbei.cbSize :=sizeof(dbei);
- dbei.cbBlob :=i;
+ dbei.cbBlob :=StrLen(blob);
dbei.pBlob :=pByte(blob);
dbei.eventType:=EVENTTYPE_MESSAGE;
dbei.timestamp:=GetCurrentTime;
dbei.szModule :=p;
- dbei.flags :=DBEF_SENT;
+ dbei.flags :=DBEF_SENT or DBEF_UTF;
db_event_add(hContact, @dbei);
mFreeMem(blob);
end
@@ -576,7 +573,7 @@ begin
CheckDlgButton(Dialog,IDC_FLAG_MESSAGE,BST_CHECKED);
if (flags and ACF_TEXTSEND)<>0 then CheckDlgButton(Dialog,IDC_TEXT_SEND,BST_CHECKED);
-
+
SetSet(Dialog,2);
end;
end;
diff --git a/plugins/Watrack/proto/proto.pas b/plugins/Watrack/proto/proto.pas
index 7dcc2e68d8..4ee38f79b3 100644
--- a/plugins/Watrack/proto/proto.pas
+++ b/plugins/Watrack/proto/proto.pas
@@ -217,7 +217,6 @@ var
data:PByte;
dataSize:int;
encodedStr:PAnsiChar;
-// pos_artist,pos_title,pos_album:PwideChar;
pos_template:pWideChar;
curpos:pWideChar;
encbuf:pWideChar;
@@ -310,17 +309,16 @@ begin
if (HistMask and hmOutInfo)<>0 then
AddEvent(ccs^.hContact,EVENTTYPE_WAT_ANSWER,DBEF_SENT,data,dataSize);
CallContactService(ccs^.hContact,PSS_MESSAGE,0,tlparam(encbuf));
+ mFreeMem(encbuf);
end
else
begin
- i:=WideToCombo(textpos,encbuf,UserCP);
+ WideToUTF8(textpos,encodedStr);
if (HistMask and hmOutInfo)<>0 then
- AddEvent(ccs^.hContact,EVENTTYPE_WAT_MESSAGE,DBEF_SENT,encbuf,i);
-// if CallContactService(ccs^.hContact,PSS_MESSAGEW,PREF_UNICODE,tlparam(encbuf))=
-// ACKRESULT_FAILED then
- CallContactService(ccs^.hContact,PSS_MESSAGE,PREF_UNICODE,tlparam(encbuf));
+ AddEvent(ccs^.hContact,EVENTTYPE_WAT_MESSAGE,DBEF_SENT or DBEF_UTF,encodedStr,StrLen(encodedStr));
+ CallContactService(ccs^.hContact,PSS_MESSAGE,0,tlparam(encodedStr));
+ mFreeMem(encodedStr);
end;
- mFreeMem(encbuf);
end;
end
else