mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-27 08:29:26 -05:00
Added: function for handling autosubscribing lobbies
This commit is contained in:
parent
22956be00f
commit
fbc1bb4e82
@ -147,6 +147,7 @@ ChatHandler::ChatHandler(StateTokenServer *sts, RsNotify *notify, RsMsgs *msgs,
|
||||
addResourceHandler("lobbies", this, &ChatHandler::handleLobbies);
|
||||
addResourceHandler("subscribe_lobby", this, &ChatHandler::handleSubscribeLobby);
|
||||
addResourceHandler("unsubscribe_lobby", this, &ChatHandler::handleUnsubscribeLobby);
|
||||
addResourceHandler("autosubscribe_lobby", this, &ChatHandler::handleAutoSubsribeLobby);
|
||||
addResourceHandler("clear_lobby", this, &ChatHandler::handleClearLobby);
|
||||
addResourceHandler("lobby_participants", this, &ChatHandler::handleLobbyParticipants);
|
||||
addResourceHandler("messages", this, &ChatHandler::handleMessages);
|
||||
@ -890,6 +891,15 @@ void ChatHandler::handleUnsubscribeLobby(Request &req, Response &resp)
|
||||
resp.setOk();
|
||||
}
|
||||
|
||||
void ChatHandler::handleAutoSubsribeLobby(Request& req, Response& resp)
|
||||
{
|
||||
ChatLobbyId chatId = 0;
|
||||
bool autosubsribe;
|
||||
req.mStream << makeKeyValueReference("chatid", chatId) << makeKeyValueReference("autosubsribe", autosubsribe);
|
||||
mRsMsgs->setLobbyAutoSubscribe(chatId, autosubsribe);
|
||||
resp.setOk();
|
||||
}
|
||||
|
||||
void ChatHandler::handleClearLobby(Request &req, Response &resp)
|
||||
{
|
||||
ChatLobbyId id = 0;
|
||||
|
@ -120,6 +120,7 @@ private:
|
||||
void handleLobbies(Request& req, Response& resp);
|
||||
void handleSubscribeLobby(Request& req, Response& resp);
|
||||
void handleUnsubscribeLobby(Request& req, Response& resp);
|
||||
void handleAutoSubsribeLobby(Request& req, Response& resp);
|
||||
void handleClearLobby(Request& req, Response& resp);
|
||||
ResponseTask* handleLobbyParticipants(Request& req, Response& resp);
|
||||
void handleMessages(Request& req, Response& resp);
|
||||
|
Loading…
Reference in New Issue
Block a user