summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--protocols/ICQ-WIM/src/groupchats.cpp4
-rw-r--r--protocols/ICQ-WIM/src/poll.cpp2
-rw-r--r--protocols/ICQ-WIM/src/proto.cpp2
-rw-r--r--protocols/ICQ-WIM/src/proto.h7
-rw-r--r--protocols/ICQ-WIM/src/server.cpp13
-rw-r--r--protocols/ICQ-WIM/src/version.h4
6 files changed, 22 insertions, 10 deletions
diff --git a/protocols/ICQ-WIM/src/groupchats.cpp b/protocols/ICQ-WIM/src/groupchats.cpp
index dd7bd8658c..603cc4101d 100644
--- a/protocols/ICQ-WIM/src/groupchats.cpp
+++ b/protocols/ICQ-WIM/src/groupchats.cpp
@@ -229,9 +229,7 @@ int CIcqProto::GroupchatEventHook(WPARAM, LPARAM lParam)
if (mir_strcmpi(gch->si->pszModule, m_szModuleName))
return 0;
- SESSION_INFO *si = Chat_Find(gch->si->ptszID, gch->si->pszModule);
- if (si == nullptr)
- return 1;
+ SESSION_INFO *si = gch->si;
switch (gch->iType) {
case GC_USER_MESSAGE:
diff --git a/protocols/ICQ-WIM/src/poll.cpp b/protocols/ICQ-WIM/src/poll.cpp
index c507c3babb..ec98ea9443 100644
--- a/protocols/ICQ-WIM/src/poll.cpp
+++ b/protocols/ICQ-WIM/src/poll.cpp
@@ -260,7 +260,7 @@ void CIcqProto::ProcessHistData(const JSONNode &ev)
void CIcqProto::ProcessImState(const JSONNode &ev)
{
for (auto &it : ev["imStates"]) {
- if (it["state"].as_mstring() != L"sent")
+ if (it["state"].as_mstring() != L"delivered")
continue;
CMStringA reqId(it["sendReqId"].as_mstring());
diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp
index c0e711e48b..f96f388313 100644
--- a/protocols/ICQ-WIM/src/proto.cpp
+++ b/protocols/ICQ-WIM/src/proto.cpp
@@ -493,7 +493,7 @@ int CIcqProto::SendMsg(MCONTACT hContact, int, const char *pszSrc)
int id = InterlockedIncrement(&m_msgId);
auto *pReq = new AsyncHttpRequest(CONN_MAIN, REQUEST_POST, ICQ_API_SERVER "/im/sendIM", &CIcqProto::OnSendMessage);
- auto *pOwn = new IcqOwnMessage(hContact, id, pReq->m_reqId);
+ auto *pOwn = new IcqOwnMessage(hContact, id, pReq->m_reqId, pszSrc);
pReq->pUserInfo = pOwn;
{
mir_cslock lck(m_csOwnIds);
diff --git a/protocols/ICQ-WIM/src/proto.h b/protocols/ICQ-WIM/src/proto.h
index c511107a8d..6da694e54b 100644
--- a/protocols/ICQ-WIM/src/proto.h
+++ b/protocols/ICQ-WIM/src/proto.h
@@ -124,8 +124,10 @@ struct IcqUser : public MZeroedObject
struct IcqOwnMessage
{
- IcqOwnMessage(MCONTACT _hContact, int _msgid, const char *guid)
- : m_hContact(_hContact), m_msgid(_msgid)
+ IcqOwnMessage(MCONTACT _hContact, int _msgid, const char *guid, const char *pszText) :
+ m_msgid(_msgid),
+ m_hContact(_hContact),
+ m_szText(mir_strdup(pszText))
{
strncpy_s(m_guid, guid, _TRUNCATE);
}
@@ -133,6 +135,7 @@ struct IcqOwnMessage
MCONTACT m_hContact;
int m_msgid;
char m_guid[50];
+ ptrA m_szText;
};
struct IcqConn
diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp
index e2ba716d97..bc7c0b4f79 100644
--- a/protocols/ICQ-WIM/src/server.cpp
+++ b/protocols/ICQ-WIM/src/server.cpp
@@ -77,6 +77,17 @@ MCONTACT CIcqProto::CheckOwnMessage(const CMStringA &reqId, const CMStringA &msg
if (!Contact::IsGroupChat(ret))
ProtoBroadcastAck(ret, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)pOwn->m_msgid, (LPARAM)msgId.c_str());
+ else {
+ T2Utf szOwnId(m_szOwnId);
+
+ PROTORECVEVENT pre = {};
+ pre.szMsgId = msgId.c_str();
+ pre.timestamp = time(0);
+ pre.szMessage = pOwn->m_szText;
+ pre.flags = PREF_SENT | PREF_CREATEREAD;
+ pre.szUserId = szOwnId;
+ ProtoChainRecvMsg(pOwn->m_hContact, &pre);
+ }
if (bRemove) {
mir_cslock lck(m_csOwnIds);
@@ -847,7 +858,7 @@ LBL_Error:
int id = InterlockedIncrement(&m_msgId);
auto *pReq = new AsyncHttpRequest(CONN_MAIN, REQUEST_POST, ICQ_API_SERVER "/im/sendIM", &CIcqProto::OnSendMessage);
- auto *pOwn = new IcqOwnMessage(pTransfer->pfts.hContact, id, pReq->m_reqId);
+ auto *pOwn = new IcqOwnMessage(pTransfer->pfts.hContact, id, pReq->m_reqId, T2Utf(wszUrl));
pReq->pUserInfo = pOwn;
{
mir_cslock lck(m_csOwnIds);
diff --git a/protocols/ICQ-WIM/src/version.h b/protocols/ICQ-WIM/src/version.h
index d5270a8de9..054ddf673a 100644
--- a/protocols/ICQ-WIM/src/version.h
+++ b/protocols/ICQ-WIM/src/version.h
@@ -1,7 +1,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 96
-#define __RELEASE_NUM 2
-#define __BUILD_NUM 3
+#define __RELEASE_NUM 3
+#define __BUILD_NUM 1
#include <stdver.h>