How can you most easily detect if user is away
Posted: Tue Dec 08, 2015 12:23 pm
I am a developer of 2 irc client libraries, one for C++ and one for C#, and there is one issue I was sort of ignoring for a while but I would like to properly sort it out.
Most of IRCD's including unreal which I am myself using, support away mechanisms, where user set themselves away using raw AWAY (with parameters to set away without to unset).
Problem here is: what is a most efficient way from client point of view to figure out that someone became away / removed away message.
Right now the way I solve this is that when you execute WHO <channel name> results similar to:
are returned. I couldn't really find any decent documentation on the format of result, but from what I have observed the 6th parameter (count from 0) contains some flags (in example here it's mostly Hr) and if G is there it means the user is away.
I also know that when you message user who is away you usually receive a message from server:
Which is cool, but pretty inefficient. If you need to keep a track of all users in channel who are away, you need to periodically send WHO for every single channel which you are in just to refresh the current status of every single user.
Is there any better way? This may be off-topic here, but I couldn't find any other section that would fit better. Nor I know about any general place where IRC standards can be discussed.
Most of IRCD's including unreal which I am myself using, support away mechanisms, where user set themselves away using raw AWAY (with parameters to set away without to unset).
Problem here is: what is a most efficient way from client point of view to figure out that someone became away / removed away message.
Right now the way I solve this is that when you execute WHO <channel name> results similar to:
Code: Select all
(Tue Dec 8 13:18:33 2015) WHO: petan #support grumpy petan.staff.tm-irc.org hub.tm-irc.org petan Hr: 0 GrumpyIRC
(Tue Dec 8 13:18:33 2015) WHO: petan #support wm-bot wikimedia-bot.services.tm-irc.org hub.tm-irc.org wm-bot Hr+: 0 wm-bot
(Tue Dec 8 13:18:33 2015) WHO: petan #support sid129243 steinsplitter.irc hub.tm-irc.org Steinsplitter Hr: 0 Steinsplitter
(Tue Dec 8 13:18:33 2015) WHO: petan #support operbot bot.tm-irc.org hidden OperBot H*&: 0 Operations Bot
I also know that when you message user who is away you usually receive a message from server:
Code: Select all
(Tue Dec 8 13:20:25 2015) :hub.tm-irc.org 301 petan petan :I am currently not here
Is there any better way? This may be off-topic here, but I couldn't find any other section that would fit better. Nor I know about any general place where IRC standards can be discussed.