client: add tag_mask attribute

The "tagtypes" command now has several sub commands which can be used
to edit that mask.
This commit is contained in:
Max Kellermann
2017-02-07 16:52:59 +01:00
parent 599d77643b
commit 29453ba196
10 changed files with 175 additions and 21 deletions

View File

@@ -23,6 +23,7 @@
#include "check.h"
#include "ClientMessage.hxx"
#include "command/CommandListBuilder.hxx"
#include "tag/Mask.hxx"
#include "event/FullyBufferedSocket.hxx"
#include "event/TimeoutMonitor.hxx"
#include "Compiler.h"
@@ -70,6 +71,11 @@ public:
/** idle flags that the client wants to receive */
unsigned idle_subscriptions;
/**
* The tags this client is interested in.
*/
TagMask tag_mask = TagMask::All();
/**
* A list of channel names this client is subscribed to.
*/

View File

@@ -23,6 +23,12 @@
#include "util/FormatString.hxx"
#include "util/AllocatedString.hxx"
TagMask
Response::GetTagMask() const
{
return GetClient().tag_mask;
}
bool
Response::Write(const void *data, size_t length)
{

View File

@@ -22,11 +22,13 @@
#include "check.h"
#include "protocol/Ack.hxx"
#include "Compiler.h"
#include <stddef.h>
#include <stdarg.h>
class Client;
class TagMask;
class Response {
Client &client;
@@ -59,6 +61,13 @@ public:
return client;
}
/**
* Accessor for Client::tag_mask. Can be used if caller wants
* to avoid including Client.hxx.
*/
gcc_pure
TagMask GetTagMask() const;
void SetCommand(const char *_command) {
command = _command;
}