msg_notice_server(luaL_optstring(L, 3, hostname), cl->nick, msg), sendbuf(cl);
return 0;
}
+static int fn_channel_privmsg(lua_State *L)
+{
+ Channel *chan = ChannelRef::check(L, 1);
+ const char *msg = luaL_checkstring(L, 2);
+ msg_privmsg_server(luaL_optstring(L, 3, hostname), chan->name, msg), sendbuf_chan(chan);
+ return 0;
+}
+static int fn_channel_notice(lua_State *L)
+{
+ Channel *chan = ChannelRef::check(L, 1);
+ const char *msg = luaL_checkstring(L, 2);
+ msg_notice_server(luaL_optstring(L, 3, hostname), chan->name, msg), sendbuf_chan(chan);
+ return 0;
+}
static int fn_channel_join(lua_State *L)
{
Client *cl = ClientRef::check(L, 1);
luaL_Reg funcs[] = {
{"client_privmsg", fn_client_privmsg},
{"client_notice", fn_client_notice},
+ {"channel_privmsg", fn_channel_privmsg},
+ {"channel_notice", fn_channel_notice},
{"channel_join", fn_channel_join},
{"channel_part", fn_channel_part},
{"channel_new", fn_channel_new},
if (!(~cl->caps & positive) && !(cl->caps & negative))
sendbuf(cl);
}
-static void sendbuf_chan(Channel *chan) {
+void sendbuf_chan(Channel *chan) {
sendbuf_chan_caps(chan, 0, 0);
}
static void sendbuf_list_sans_self_caps(Client *client, clientset &ls, int cookie, int positive, int negative) {
#include "net.hpp"
#include "util.hpp"
#define is_registered(cl) ((cl)->regstate == REG_REGISTERED)
+void sendbuf_chan(Channel *chan);
void sendbuf_monitor(const char *nick, int cookie, int positive, int negative);
const char *format_umodes(Client *cl);
bool irc_parse_line(Client *client, char *p, char *end);