Forward ChatState messages to backends
This commit is contained in:
parent
f55f18b579
commit
2fcf167a4e
3 changed files with 11 additions and 10 deletions
|
@ -561,6 +561,7 @@ class SpectrumNetworkPlugin : public NetworkPlugin {
|
|||
void handleTypingRequest(const std::string &user, const std::string &buddyName) {
|
||||
PurpleAccount *account = m_sessions[user];
|
||||
if (account) {
|
||||
LOG4CXX_INFO(logger, user << ": sending typing notify to " << buddyName);
|
||||
serv_send_typing_wrapped(purple_account_get_connection_wrapped(account), buddyName.c_str(), PURPLE_TYPING);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,10 +13,10 @@ admin_password=test
|
|||
#cert=server.pfx #patch to PKCS#12 certificate
|
||||
#cert_password=test #password to that certificate if any
|
||||
users_per_backend=10
|
||||
#backend=../..//backends/swiften/spectrum2_swiften_backend
|
||||
backend=../..//backends/libpurple/spectrum2_libpurple_backend
|
||||
#backend=../../backends/twitter/spectrum2_twitter_backend
|
||||
backend=/home/hanzz/code/libtransport/backends/libpurple/spectrum2_libpurple_backend
|
||||
protocol=prpl-jabber
|
||||
#backend=/home/hanzz/code/libtransport/backends/libpurple/spectrum2_communi_backend
|
||||
protocol=prpl-icq
|
||||
#protocol=prpl-msn
|
||||
#protocol=any
|
||||
#protocol=prpl-icq
|
||||
|
|
|
@ -334,7 +334,13 @@ void UserManager::handleMessageReceived(Swift::Message::ref message) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (message->getBody().empty()) {
|
||||
// Do not count chatstate notification...
|
||||
boost::shared_ptr<Swift::ChatState> statePayload = message->getPayload<Swift::ChatState>();
|
||||
if (!statePayload) {
|
||||
messageToBackendSent();
|
||||
}
|
||||
|
||||
if (message->getBody().empty() && !statePayload) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -344,12 +350,6 @@ void UserManager::handleMessageReceived(Swift::Message::ref message) {
|
|||
}
|
||||
|
||||
user->getConversationManager()->handleMessageReceived(message);
|
||||
|
||||
// Do not count chatstate notification...
|
||||
boost::shared_ptr<Swift::ChatState> statePayload = message->getPayload<Swift::ChatState>();
|
||||
if (!statePayload) {
|
||||
messageToBackendSent();
|
||||
}
|
||||
}
|
||||
|
||||
void UserManager::handleGeneralPresenceReceived(Swift::Presence::ref presence) {
|
||||
|
|
Loading…
Add table
Reference in a new issue