Skip to content

Commit

Permalink
Add support for the stable 'bot' mtag
Browse files Browse the repository at this point in the history
https://ircv3.net/specs/extensions/bot-mode was ratified a few months ago
(ircv3/ircv3-specifications#495)

This commit keeps the draft mtag, for now.
  • Loading branch information
progval committed Jul 2, 2022
1 parent 514a1f6 commit 71aae4c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/modules/bot-tag.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ MOD_INIT()

MARK_AS_OFFICIAL_MODULE(modinfo);

memset(&mtag, 0, sizeof(mtag));
mtag.name = "bot";
mtag.is_ok = bottag_mtag_is_ok;
mtag.flags = MTAG_HANDLER_FLAGS_NO_CAP_NEEDED;
MessageTagHandlerAdd(modinfo->handle, &mtag);

memset(&mtag, 0, sizeof(mtag));
mtag.name = "draft/bot";
mtag.is_ok = bottag_mtag_is_ok;
Expand Down Expand Up @@ -82,7 +88,14 @@ void mtag_add_bottag(Client *client, MessageTag *recv_mtags, MessageTag **mtag_l

if (IsUser(client) && has_user_mode(client, 'B'))
{
MessageTag *m = safe_alloc(sizeof(MessageTag));
MessageTag *m;

m = safe_alloc(sizeof(MessageTag));
safe_strdup(m->name, "bot");
m->value = NULL;
AddListItem(m, *mtag_list);

m = safe_alloc(sizeof(MessageTag));
safe_strdup(m->name, "draft/bot");
m->value = NULL;
AddListItem(m, *mtag_list);
Expand Down

0 comments on commit 71aae4c

Please sign in to comment.