Quantcast
Channel: UnrealIRCd Forums
Viewing all articles
Browse latest Browse all 43

UnrealIRCd modules (third party) • Module that adds a message tag to channel messages, how to?

$
0
0
I want to write a module that tags all channel messages with a custom message tag. I tried a few things, but can't get it working - or at least the IRC client (KittehChat java based client) doesn't see the new messages.

Does the below look right, or am I way off? The log message appears no problem. Its just that the clients don't see any sign of the taforever.com/name=value tag in the raw message.

Is it the right hook and is it the right method of adding tags to messages??

Does my module need to register the new message tag before its recognised??

Or is it likely a client-side problem, does the client need to send additional CAP REQ arguments on connect?? It currently CAP REQ's the following "userhost-in-names message-tags batch multi-prefix extended-join away-notify setname account-tag chghost account-notify labeled-response server-time"

Any pointers would be greatly appreciated!

Code:

#include "unrealircd.h"ModuleHeader MOD_HEADER = {"third/my_module","1.0","My module that adds message tags","TA Forever","unrealircd-6",};int channel_message_hook(Client *client, Channel *channel, MessageTag **mtags, const char *text, SendType sendtype){unreal_log(ULOG_INFO, "taforever.com", "channel_message_hook", NULL, "entry");MessageTag *m = safe_alloc(sizeof(MessageTag));safe_strdup(m->name, "taforever.com/name");safe_strdup(m->value, "value");AppendListItem(m, *mtags);return 0;}MOD_INIT() {HookAdd(modinfo->handle, HOOKTYPE_PRE_CHANMSG, 0, channel_message_hook);return MOD_SUCCESS;}MOD_LOAD(){return MOD_SUCCESS;}MOD_UNLOAD(){return MOD_SUCCESS;}

Statistics: Posted by Axle1975 — Wed Nov 13, 2024 6:54 am — Replies 6 — Views 91



Viewing all articles
Browse latest Browse all 43

Trending Articles