Ejemplo n.º 1
0
	void HubInfo::on(ClientListener::UserRemoved, const Client*, const OnlineUserPtr& aUser) noexcept {
		if (!aUser->isHidden()) {
			view.onItemRemoved(aUser);
		}

		maybeSend("hub_user_disconnected", [&] { return Serializer::serializeItem(aUser, onlineUserPropertyHandler); });
	}
Ejemplo n.º 2
0
	void Serializer::appendOnlineUserFlags(const OnlineUserPtr& aUser, StringSet& flags_) noexcept {
		if (aUser->getIdentity().isAway()) {
			flags_.insert("away");
		}

		if (aUser->getIdentity().isOp()) {
			flags_.insert("op");
		}

		if (aUser->getIdentity().isBot() || aUser->getIdentity().isHub()) {
			flags_.insert("bot");
		}

		if (aUser->isHidden()) {
			flags_.insert("hidden");
		}

		if (aUser->supportsCCPM()) {
			flags_.insert("ccpm");
		}

		auto cm = aUser->getIdentity().getConnectMode();
		if (!aUser->getUser()->isNMDC() && (cm == Identity::MODE_NOCONNECT_PASSIVE || cm == Identity::MODE_NOCONNECT_IP || cm == Identity::MODE_UNDEFINED)) {
			flags_.insert("noconnect");
		} else if (!aUser->getIdentity().isTcpActive(aUser->getClient())) {
			flags_.insert("passive");
		}
	}
Ejemplo n.º 3
0
	void HubInfo::onUserUpdated(const OnlineUserPtr& aUser, const PropertyIdSet& aUpdatedProperties) noexcept {
		if (!aUser->isHidden()) {
			view.onItemUpdated(aUser, aUpdatedProperties);
		}

		maybeSend("hub_user_updated", [&] { return Serializer::serializeItem(aUser, onlineUserPropertyHandler); });
	}