summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/messages.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2013-09-29 20:47:11 +0000
committerRobert Pösel <robyer@seznam.cz>2013-09-29 20:47:11 +0000
commit7538e4d50ab714f503df3c82c9ef94e90fb49ad9 (patch)
tree6c531d21f0c694a9ced942142784de5297364c1b /protocols/FacebookRM/src/messages.cpp
parent2799ac954aa83e0f3a1c57dacadd3a41fa9ba6bb (diff)
Facebook: first experimental implementation of multi user chats (thanks to nobodyreal for patch)
git-svn-id: http://svn.miranda-ng.org/main/trunk@6273 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/messages.cpp')
-rw-r--r--protocols/FacebookRM/src/messages.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/protocols/FacebookRM/src/messages.cpp b/protocols/FacebookRM/src/messages.cpp
index 298413cec4..5a7dc086ae 100644
--- a/protocols/FacebookRM/src/messages.cpp
+++ b/protocols/FacebookRM/src/messages.cpp
@@ -97,8 +97,10 @@ void FacebookProto::SendChatMsgWorker(void *p)
Log(" Got thread info: %s = %s", data->chat_id.c_str(), tid.c_str());
}
- if (!tid.empty())
- facy.send_message(tid, data->msg, &err_message, MESSAGE_TID);
+ if (!tid.empty()) {
+ if (facy.send_message(tid, data->msg, &err_message, MESSAGE_TID))
+ UpdateChat(data->chat_id.c_str(), facy.self_.user_id.c_str(), facy.self_.real_name.c_str(), data->msg.c_str());
+ }
}
delete data;
@@ -110,7 +112,7 @@ int FacebookProto::SendMsg(HANDLE hContact, int flags, const char *msg)
if (flags & PREF_UNICODE)
msg = mir_utf8encode(msg);
- facy.msgid_ = (facy.msgid_ % 1024)+1;
+ facy.msgid_ = (facy.msgid_ % 1024) + 1;
ForkThread(&FacebookProto::SendMsgWorker, new send_direct(hContact, msg, (HANDLE)facy.msgid_));
return facy.msgid_;
}
@@ -138,15 +140,13 @@ void FacebookProto::SendTypingWorker(void *p)
facy.is_typing_ = (typing->status == PROTOTYPE_SELFTYPING_ON);
SleepEx(2000, true);
- if (!facy.is_typing_ == (typing->status == PROTOTYPE_SELFTYPING_ON))
- {
+ if (!facy.is_typing_ == (typing->status == PROTOTYPE_SELFTYPING_ON)) {
delete typing;
return;
}
DBVARIANT dbv;
- if (!getString(typing->hContact, FACEBOOK_KEY_ID, &dbv))
- {
+ if (!getString(typing->hContact, FACEBOOK_KEY_ID, &dbv)) {
std::string data = "&source=mercury-chat";
data += (typing->status == PROTOTYPE_SELFTYPING_ON ? "&typ=1" : "&typ=0"); // PROTOTYPE_SELFTYPING_OFF
data += "&to=" + std::string(dbv.pszVal);