registerSub

Attaches a notifications listener to an existing subscription.

Signature

Copied to clipboard!
void registerSub(const std::string& channel, const std::string& room_id, const std::string& filters, bool subscribe_to_self, NotificationListener* listener);

Arguments

Argument Type Description
channel
const std::string&
A string representing the channel of the subscription
room_id
const std::string&
A string representing the roomId of the subscription
filters
const std::string&
JSON string representing the filters of the subscription
subscribe_to_self
bool
Subscribe to notifications fired by our own queries
listener
NotificationListener*
A pointer to the listener

listener

A c++11 lambda which takes a const std::string argument. EventListener is defined as const std::function<void(const std::string)>.