2019-06-27 10:18:23 +02:00
|
|
|
// Matrix Construct
|
|
|
|
//
|
|
|
|
// Copyright (C) Matrix Construct Developers, Authors & Contributors
|
|
|
|
// Copyright (C) 2016-2019 Jason Volk <jason@zemos.net>
|
|
|
|
//
|
|
|
|
// Permission to use, copy, modify, and/or distribute this software for any
|
|
|
|
// purpose with or without fee is hereby granted, provided that the above
|
|
|
|
// copyright notice and this permission notice is present in all copies. The
|
|
|
|
// full license for this software is available in the LICENSE file.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#define HAVE_IRCD_M_USER_HIGHLIGHT_H
|
|
|
|
|
|
|
|
/// Interface to user highlighting and counting.
|
|
|
|
struct ircd::m::user::highlight
|
|
|
|
{
|
2019-06-27 10:51:47 +02:00
|
|
|
static conf::item<bool> enable_count;
|
|
|
|
static conf::item<bool> match_mxid_full;
|
|
|
|
static conf::item<bool> match_mxid_local_cs;
|
|
|
|
static conf::item<bool> match_mxid_local_ci;
|
2019-08-07 07:51:50 +02:00
|
|
|
static conf::item<bool> match_at_room;
|
2019-06-27 10:51:47 +02:00
|
|
|
|
2019-08-08 01:23:55 +02:00
|
|
|
static bool imatch(const string_view &text, const string_view &arg);
|
|
|
|
static bool match(const string_view &text, const string_view &arg);
|
|
|
|
|
|
|
|
m::user user;
|
|
|
|
|
|
|
|
public:
|
2019-06-27 10:51:47 +02:00
|
|
|
bool match(const string_view &text) const;
|
2019-06-27 10:18:23 +02:00
|
|
|
bool has(const event &) const;
|
|
|
|
bool has(const event::idx &) const;
|
|
|
|
|
2019-08-12 13:10:28 +02:00
|
|
|
bool for_each(const m::room &, const event::idx_range &, const event::closure_idx_bool &) const;
|
2019-06-27 10:18:23 +02:00
|
|
|
size_t count_between(const m::room &, const event::idx_range &) const;
|
|
|
|
size_t count_to(const m::room &, const event::idx &) const;
|
|
|
|
size_t count(const m::room &) const;
|
|
|
|
size_t count() const;
|
|
|
|
|
|
|
|
highlight(const m::user &user)
|
|
|
|
noexcept
|
|
|
|
:user{user}
|
|
|
|
{}
|
|
|
|
};
|