This repository has been archived by the owner on May 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
respub.h
97 lines (85 loc) · 4.35 KB
/
respub.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/**
* COPYRIGHT 2014 (C) Jason Volk
* COPYRIGHT 2014 (C) Svetlana Tkachenko
*
* DISTRIBUTED UNDER THE GNU GENERAL PUBLIC LICENSE (GPL) (see: LICENSE)
*/
using Tokens = std::vector<const std::string *>;
using Selection = std::forward_list<Tokens::const_iterator>;
std::string detok(const Tokens &tokens);
Tokens subtok(const std::vector<std::string> &tokens);
Tokens subtok(const Tokens &tokens);
class ResPublica
{
using Meth = Locutor::Method;
static constexpr auto flush = Locutor::flush;
Bot ⊥
Opts &opts;
Sess &sess;
Users &users;
Chans &chans;
Events &events;
Vdb vdb;
Praetor praetor;
Voting voting;
bool delta_trial_jeopardy(const Msg &m, Chan &c, User &u, const Delta &d);
void delta_trial(const Msg &m, Chan &c, User &u, const Delta &d);
void delta_appeal(const Msg &m, Chan &c, User &u, const Delta &d);
void handle_delta(const Msg &m, Chan &c, User &u, const Delta &d);
void vote_access(Locutor &out, const Chan &c, const User &u, const Tokens &t);
void vote_stats_chan_user(Locutor &out, const std::string &chan, const std::string &user, const Tokens &t);
void vote_stats_user(Locutor &out, const std::string &user, const Tokens &t);
void vote_stats_chan(Locutor &out, const std::string &chan, const Tokens &t);
void opinion(const Chan &c, const User &u, Locutor &out, const Tokens &t);
void vote_list_oneline(const Chan &c, const User &u, Locutor &out, const Vote &vote);
void vote_list_oneline(const Chan &c, const User &u, Locutor &out, const std::list<id_t> &result);
void handle_vote_info(const Msg &m, const User &u, Locutor &out, const Tokens &t, const Vote &vote);
void handle_vote_list(const Msg &m, const User &u, Locutor &out, const Tokens &t, const Vote &vote);
void handle_vote_list(const Msg &m, const User &u, Locutor &out, const Tokens &t, const id_t &id);
void handle_vote_list(const Msg &m, const Chan &c, const User &u, Locutor &out, const Tokens &t);
void handle_help(const Msg &m, Locutor &out, const Tokens &t);
// Privmsg stack
void handle_vote_access(const Msg &m, User &u, const Tokens &t);
void handle_vote_stats(const Msg &m, User &u, const Tokens &t);
void handle_vote_ballot(const Msg &m, User &u, const Tokens &t, const Ballot &b);
void handle_vote_list(const Msg &m, User &u, const Tokens &t);
void handle_vote_id(const Msg &m, User &u, const Tokens &t);
void handle_vote(const Msg &m, User &u, Tokens t);
void handle_opinion(const Msg &m, User &u, const Tokens &t);
void handle_debug(const Msg &m, User &u, const Tokens &t);
void handle_version(const Msg &m, User &u, const Tokens &t);
void handle_praetor(const Msg &m, User &u, const Tokens &t);
void handle_regroup(const Msg &m, User &u, const Tokens &t);
void handle_whoami(const Msg &m, User &u, const Tokens &t);
void handle_config(const Msg &m, User &u, const Tokens &t);
void handle_cmd(const Msg &m, User &u);
// !vote channel stack
void handle_vote_access(const Msg &m, Chan &c, User &u, const Tokens &t);
void handle_vote_stats(const Msg &m, Chan &c, User &u, const Tokens &t);
void handle_vote_eligible(const Msg &m, Chan &c, User &u, const Tokens &t);
void handle_vote_config(const Msg &m, Chan &c, User &u, const Tokens &t);
void handle_vote_list(const Msg &m, Chan &c, User &u, const Tokens &t, const id_t &id);
void handle_vote_list(const Msg &m, Chan &c, User &u, const Tokens &t);
void handle_vote_ballot(const Msg &m, Chan &c, User &u, const Tokens &t, const Ballot &b);
void handle_vote_cancel(const Msg &m, Chan &c, User &u, const Tokens &t);
void handle_vote_id(const Msg &m, Chan &c, User &u, const Tokens &t);
void handle_vote(const Msg &m, Chan &c, User &u, Tokens t);
void handle_opinion(const Msg &m, Chan &c, User &u, const Tokens &t);
void handle_version(const Msg &m, Chan &c, User &u, const Tokens &t);
void handle_cmd(const Msg &m, Chan &c, User &u);
// Primary dispatch
void handle_mlock(const Msg &m, Chan &c);
void handle_inviting(const Msg &m, Chan &c);
void handle_knock(const Msg &m, Chan &c);
void handle_on_chan(const Msg &m, Chan &c, User &u);
void handle_not_op(const Msg &m, Chan &c);
void handle_nick(const Msg &m, User &u);
void handle_notice(const Msg &m, User &u);
void handle_privmsg(const Msg &m, User &u);
void handle_cmode(const Msg &m, Chan &c);
void handle_notice(const Msg &m, Chan &c, User &u);
void handle_privmsg(const Msg &m, Chan &c, User &u);
public:
ResPublica(Bot &bot);
~ResPublica() noexcept;
};