Probably working invisible state, but I'm lazy to test it after midnight...
This commit is contained in:
parent
c38103451c
commit
f47187d464
2 changed files with 14 additions and 1 deletions
|
@ -311,6 +311,9 @@ class SpectrumNetworkPlugin : public NetworkPlugin {
|
|||
st = PURPLE_STATUS_OFFLINE;
|
||||
break;
|
||||
}
|
||||
case 255:
|
||||
st = PURPLE_STATUS_INVISIBLE;
|
||||
break;
|
||||
default:
|
||||
st = PURPLE_STATUS_AVAILABLE;
|
||||
break;
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "Swiften/Network/BoostConnectionServer.h"
|
||||
#include "Swiften/Elements/AttentionPayload.h"
|
||||
#include "Swiften/Elements/XHTMLIMPayload.h"
|
||||
#include "Swiften/Elements/InvisiblePayload.h"
|
||||
#include "pbnetwork.pb.h"
|
||||
#include "sys/wait.h"
|
||||
#include "sys/signal.h"
|
||||
|
@ -785,7 +786,16 @@ void NetworkPluginServer::handleUserPresenceChanged(User *user, Swift::Presence:
|
|||
|
||||
pbnetwork::Status status;
|
||||
status.set_username(user->getJID().toBare());
|
||||
status.set_status((int) presence->getShow());
|
||||
|
||||
bool isInvisible = presence->getPayload<Swift::InvisiblePayload>() != NULL;
|
||||
if (isInvisible) {
|
||||
LOG4CXX_INFO(logger, "This presence is invisible");
|
||||
status.set_status(255);
|
||||
}
|
||||
else {
|
||||
status.set_status((int) presence->getShow());
|
||||
}
|
||||
|
||||
status.set_statusmessage(presence->getStatus());
|
||||
|
||||
std::string message;
|
||||
|
|
Loading…
Add table
Reference in a new issue