View Issue Details

IDProjectCategoryView StatusLast Update
0006213unrealircdpublic2023-01-14 16:00
Reporterarmyn Assigned Tosyzop  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
Product Version6.0.5 
Summary0006213: The realname is not in message tags when receiving a privmsg
DescriptionEverything is mentioned in the subject. There is all the data but only the realname is missing.
The realname is very useful to retrieve the age and gender of the person sending a message to the bot in a very direct way, without going through any other raw/async/await and all that.

Is this an oversight?
TagsNo tags attached.
3rd party modules

Activities

syzop

2023-01-13 07:46

administrator   ~0022704

The realname is available under user.username, see https://www.unrealircd.org/docs/JSON_logging#client_object under "client.user object".

But you talk about privmsg. There is no logging of messages in unrealircd, so you must mean something else, and possibly not json logging at all? :)

armyn

2023-01-13 21:29

reporter   ~0022705

ah yes indeed there is no "log json" for the privmsg, I always confuse with the "raw view" of the irc-framework

{
   type: 'privmsg',
   from_server: false,
   nickname: 'testor',
   ident: 'o-dcs-fr832b21b-4',
   hostname: 'B46E5A17:3E0C15BB:D48EA5D0:IP',
   target: 'Sysop',
   group: undefined,
   message: '...',
   tags: {
     'unrealircd.org/geoip': 'FR',
     'unrealircd.org/userhost': 'o-dcs-fr832b21b-4@...',
     'unrealircd.org/userip': 'o-dcs-fr832b21b-4@.....',
     msgid: '4M68baRh7a76xpQo62szf8',
     time: '2022-09-19T23:53:43.390Z'
   },
   time: 1663631623390,
   account: undefined,
   batch: undefined,
   reply: [Function (anonymous)]
}


It's just a shame that there isn't a ready-made variable for the realname, each time I have to go through another raw with asynchronous/await

tags: {
'unrealircd.org/geoip': 'FR',
'realname': '18/F/75',

Technically there is no way to put a realname variable in "tags"?

syzop

2023-01-14 16:00

administrator   ~0022711

Right, I think you mean message tags. I don't think that is useful to the general UnrealIRCd community. I mean, in normal circumstances, it is rather a waste of unnecessary data.

It can be done in a 3rd party module. It would be relatively easy to make a message tag that is automatically added that includes the realname.
You could copy src/modules/account-tag.c for inspiration, then replace the IsLoggedin() check with an IsUser(), replace the safe_strdup(m->value, client->user->account); with safe_strdup(m->value, client->info);
And mass replace all the "account" words to "realname" (and "ACCOUNT" to "REALNAME").

Issue History

Date Modified Username Field Change
2023-01-12 19:54 armyn New Issue
2023-01-13 07:46 syzop Note Added: 0022704
2023-01-13 07:46 syzop Assigned To => syzop
2023-01-13 07:46 syzop Status new => feedback
2023-01-13 21:29 armyn Note Added: 0022705
2023-01-14 15:51 syzop Summary The realname is not displayed in JSON logging when receiving a privmsg => The realname is not in message tags when receiving a privmsg
2023-01-14 16:00 syzop Status feedback => closed
2023-01-14 16:00 syzop Resolution open => no change required
2023-01-14 16:00 syzop Note Added: 0022711