1 #ifndef _ots_ChatSupervisor_h
2 #define _ots_ChatSupervisor_h
4 #include "otsdaq/CoreSupervisors/CoreSupervisorBase.h"
21 virtual void defaultPage(xgi::Input* in, xgi::Output* out)
override;
22 void Default(xgi::Input* in, xgi::Output* out);
24 virtual void request(
const std::string& requestType,
27 const WebUsers::RequestUserInfo& userInfo)
override;
38 std::vector<std::string> ChatHistoryEntry_, ChatHistoryAuthor_;
39 std::vector<time_t> ChatHistoryTime_;
40 std::vector<uint64_t> ChatHistoryIndex_;
42 uint64_t ChatLastUpdateIndex;
44 std::vector<std::string> ChatUsers_;
45 std::vector<time_t> ChatUsersTime_;
47 std::string chatSupervisorToolsPath_;
49 std::string slackInboxPath_;
54 CHAT_HISTORY_EXPIRATION_TIME = 30 * 60,
55 CHAT_HISTORY_MAX_ENTRIES = 100,
58 uint64_t incrementAndGetLastUpdate();
59 bool isLastUpdateIndexStale(uint64_t last);
60 bool isChatOld(uint64_t chatIndex, uint64_t last);
62 void newUser(
const std::string& user);
63 void newChat(
const std::string& chat,
const std::string& user,
bool fromSlack =
false);
64 void sendToSlack(
const std::string& user,
const std::string& message);
65 void receiveFromSlack();
66 void startSlackDaemon();
67 void stopSlackDaemon();
68 void removeChatHistoryEntry(uint64_t i);
69 void removeChatUserEntry(uint64_t i);
70 void cleanupExpiredChats(
void);
74 uint64_t lastUpdateIndex,
75 const std::string& user);
77 void escapeChat(std::string& chat);
virtual void request(const std::string &requestType, cgicc::Cgicc &cgiIn, HttpXmlDocument &xmlOut, const WebUsers::RequestUserInfo &userInfo) override
end forceSupervisorPropertyValues()
virtual void forceSupervisorPropertyValues(void) override
override to force supervisor property values (and ignore user settings)