Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/IRCv3
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ The following capabilities are supported by Eggdrop:
- account-notify
- account-tag
- away-notify
- batch
- BOT 005 mode
- cap-notify
- chghost
- echo-message
- extended-join
- invite-notify
- labeled-response
- message-tags
- Monitor
- server-time
Expand Down
7 changes: 7 additions & 0 deletions doc/sphinx_source/using/tcl-commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,13 @@ monitor <add/delete/list/online/offline/status/clear> [nickname]

Module: irc

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
getbatch <reference>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Description: provides information about a current IRCv3 batch session.

Returns: a dict of the information Eggdrop is tracking for an open batch session, containing the keys ```reftag type tags args parent suppress started seq```, where reftag is the case-sensitive batch session reference tag, type is the batch type, tags is a nested dict of the message tags that were associated with the BATCH command, parent is the reference tag for a parent batch session, suppress is 1 if a batch bind is suppressing further bind processing of this batch session and 0 if not, started is a timestamp of when the batch was opened, seq is an internally-tracked sequence number used for tracking batch session ordering, and args is everything after the ```type``` portion of the command.

^^^^^^^^^^^^^^^
accounttracking
^^^^^^^^^^^^^^^
Expand Down
11 changes: 11 additions & 0 deletions doc/tcl-commands.doc
Original file line number Diff line number Diff line change
Expand Up @@ -4050,6 +4050,17 @@ the Tcl proc, and an explanation.
the setting that was changed, and the value it was set to (0/1 for
-/+, string, or X:Y formatted value).

(58) BATCH (stackable)

bind batch <flags> <type> <proc>

procname <reftag> <type> <event> <parent> <args> <tags>

Description: triggered when a server opens, closes, or Eggdrop discards an IRCv3 batch. flags are ignored, type is the batch type and can be used with wildcards. For the proc, reftag is the reference tag identifying the batch and is case-sensitive, type is the batch type such as 'netsplit' or 'chathistory'. Event can be 'start' (when the server opens the batch), 'end' (when the server closes it), or 'discard' (Eggdrop drops when its parent batch closes first or ages out after not being closed by the server). parent is the reference tag of the enclosing batch if this batch is nested inside another, otherwise it is empty. args is the remainder of the BATCH line following the type, and tags is a Tcl dict of the message tags present on the line that opened the batch (or empty if there were none).

Module: server


Return Values

Several bindings pay attention to the value you return from the
Expand Down
13 changes: 9 additions & 4 deletions eggdrop.conf
Original file line number Diff line number Diff line change
Expand Up @@ -1086,10 +1086,9 @@ server add ssl.example.net +7000
#
# The capabilities currently known to be supported by Eggdrop are as follows:
#
# account-notify, account-tag, away-notify, chghost, echo-message,
# extended-join, invite-notify, message-tags, server-time, sasl, setname,
# +typing
#
# account-notify, account-tag, away-notify, batch, chghost, echo-message,
# extended-join, invite-notify, labeled-response, message-tags, server-time,
# sasl, setname, +typing

# SASL is a method that allows Eggdrop to authenticate with a NickServ service
# as part of the connection process to a server, eliminating the need to later
Expand Down Expand Up @@ -1145,12 +1144,18 @@ server add ssl.example.net +7000
# To request the account-notify feature via CAP, set this to 1
set account-notify 1

# To request the batch feature vi CAP, set this to 1
#set batch 0

# To request the extended-join feature via CAP, set this to 1
set extended-join 1

# To request the invite-notify feature via CAP, set this to 1
#set invite-notify 0

# To request the labeled-response feature via CAP, set this to 1
#set labeled-response 0

# To request the message-tags feature via CAP, set this to 1
#set message-tags 0

Expand Down
40 changes: 25 additions & 15 deletions src/mod/irc.mod/chan.c
Original file line number Diff line number Diff line change
Expand Up @@ -2588,29 +2588,39 @@ static int gotquit(char *from, char *msg)
memberlist *m;
struct chanset_t *chan, *oldchan = NULL;
struct userrec *u;
batch_t *b;

strlcpy(from2, from, sizeof from2);
nick = splitnick(&from);
fixcolon(msg);
/* Fred1: Instead of expensive wild_match on signoff, quicker method.
* Determine if signoff string matches "%.% %.%", and only one
* space.
*
* 30 years later... If the server sent this QUIT inside an IRCv3 netsplit
* batch, it has told us outright that this is a split and there is nothing
* to guess at.
*/
p = strchr(msg, ' ');
if (p && (p == strrchr(msg, ' '))) {
char *z1, *z2;

*p = 0;
z1 = strchr(p + 1, '.');
z2 = strchr(msg, '.');
if (z1 && z2 && (*(z1 + 1) != 0) && (z1 - 1 != p) &&
(z2 + 1 != p) && (z2 != msg)) {
/* Server split, or else it looked like it anyway (no harm in
* assuming)
*/
split = 1;
} else
*p = ' ';
b = batch_get_current();
if (b && !strcmp(b->type, "netsplit")) {
split = 1;
} else {
p = strchr(msg, ' ');
if (p && (p == strrchr(msg, ' '))) {
char *z1, *z2;

*p = 0;
z1 = strchr(p + 1, '.');
z2 = strchr(msg, '.');
if (z1 && z2 && (*(z1 + 1) != 0) && (z1 - 1 != p) &&
(z2 + 1 != p) && (z2 != msg)) {
/* Server split, or else it looked like it anyway (no harm in
* assuming)
*/
split = 1;
} else
*p = ' ';
}
}
for (chan = chanset; chan; chan = chan->next) {
oldchan = chan;
Expand Down
6 changes: 3 additions & 3 deletions src/mod/irc.mod/irc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1426,14 +1426,14 @@ char *irc_start(Function *global_funcs)

global = global_funcs;

module_register(MODULE_NAME, irc_table, 1, 5);
module_register(MODULE_NAME, irc_table, 1, 6);
if (!module_depend(MODULE_NAME, "eggdrop", 108, 0)) {
module_undepend(MODULE_NAME);
return "This module requires Eggdrop 1.8.0 or later.";
}
if (!(server_funcs = module_depend(MODULE_NAME, "server", 1, 5))) {
if (!(server_funcs = module_depend(MODULE_NAME, "server", 1, 6))) {
module_undepend(MODULE_NAME);
return "This module requires server module 1.5 or later.";
return "This module requires server module 1.6 or later.";
}
if (!(channels_funcs = module_depend(MODULE_NAME, "channels", 1, 1))) {
module_undepend(MODULE_NAME);
Expand Down
2 changes: 1 addition & 1 deletion src/mod/server.mod/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ distclean: clean
.././server.mod/tclisupport.c .././server.mod/servmsg.c \
.././server.mod/../irc.mod/irc.h \
.././server.mod/../channels.mod/channels.h .././server.mod/sasl.c \
.././server.mod/cmdsserv.c .././server.mod/tclserv.c
.././server.mod/cmdsserv.c .././server.mod/tclserv.c .././server.mod/batch.c
Loading
Loading