Added a method to send to all subscribers on subscription.

This commit is contained in:
Brad Arant 2023-06-12 12:41:14 -07:00
parent e78f0cd4f8
commit cb2a61bed9
2 changed files with 10 additions and 0 deletions

View File

@ -70,4 +70,12 @@ namespace core {
return 0;
}
void Subscription::sendToAll(std::stringstream &data, TCPSession &sender) {
for (auto session : subscribers)
if (session != &sender)
session->write(data.str());
data.str("");
}
}

View File

@ -32,6 +32,8 @@ namespace core
bool subInvite(TCPSession &session);
void sendToAll(std::stringstream &data, TCPSession &sender);
std::string id;
std::string mode;
TCPSession *owner;