22static constexpr std::chrono::steady_clock::duration
COMPOSING_TIMEOUT {std::chrono::seconds(12)};
27 : ioContext_(
Manager::instance().ioContext())
29 , accountId_(acc->getAccountID())
31 , selfUri_(acc->getUsername())
36 for (
auto&
watcher : watcher_) {
46 return fmt::format(
"<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n"
47 "<isComposing><state>{}</state>{}</isComposing>",
49 conversationId.empty() ?
"" :
"<conversation>" + conversationId +
"</conversation>");
55 auto acc = acc_.lock();
56 if (!acc || !acc->isComposingEnabled())
58 auto [
it,
res] = watcher_.emplace(
typer, asio::steady_timer {*ioContext_});
65 if (
typer != selfUri_)
77 auto acc = acc_.lock();
78 if (!acc || !acc->isComposingEnabled())
80 if (watcher_.erase(
typer)) {
84 if (
typer != selfUri_) {
91Typers::onTyperTimeout(
const asio::error_code&
ec,
const std::string&
typer)
93 if (
ec == asio::error::operation_aborted)
Manager (controller) of daemon.
void removeTyper(const std::string &typer, bool sendMessage=false)
void addTyper(const std::string &typer, bool sendMessage=false)
Add typer to the list of typers.
Typers(const std::shared_ptr< JamiAccount > &acc, const std::string &convId)
void emitSignal(Args... args)
static constexpr const char MIME_TYPE_IM_COMPOSING[]
std::string getIsComposing(const std::string &conversationId, bool isWriting)
static constexpr std::chrono::steady_clock::duration COMPOSING_TIMEOUT