ircnet / ircd

17 stars 6 forks source link

away-notify #16

Open patrick-irc opened 1 month ago

patrick-irc commented 1 month ago

See https://ircv3.net/specs/extensions/away-notify

When this capability is enabled, clients will be sent an AWAY message when 1. a user sharing a channel with them sets, changes or removes their away state 2. a user joins and has an away message set.

patrick-irc commented 1 month ago

Currently AWAY will not be propagated to other servers. Only a usermode marks the user as away on remote servers. I think we should keep it like that especially because we do not want to blow up the burst with AWAY messages.

So basically we act when +/-a has been received. We can pre-define a standard away message like "away" or "gone" and if the user wants to see the real message, he has to do WHOIS.

eaescob commented 1 month ago

I was thinking about this approach and I agree, sending both MODE +a/-a and AWAY during burst makes no sense. We can handle away-notify when MODE +a/-a is received just like we do (for the local server) when AWAY is received. Away-notify is meant to help scripts/channel ops/bots know who's away or not in channels, I'm not sure the priority is to know the away message. Requiring a WHOIS to see the away message is fine, the goal was to remove the need for /WHO the whole channel, which I think this accomplishes that.

wilhelmy commented 1 month ago

Other ircd implementation sync away messages across servers, because we don't have the memory or network limits from 1989 anymore. Unless your goal with ircd2 is to still support running on a toaster that's connected via dialup for all eternity. :)

Edit: WHOIS isn't enough, you have to issue WHOIS \ \ which sends a remote WHOIS to the server the user is connected to, which then handles the request because only it knows the away message. I don't think many users are even aware of this second argument to WHOIS, especially since all other chat networks I've seen sync the away message...

patrick-irc commented 1 month ago

Think about 5.000 idlers having auto-away enabled. It means 5.000 additional lines when a server relinks (burst).

wilhelmy commented 1 month ago

The server has to send one line per user on burst anyway, so it doesn't even double the amount of network traffic. I really think this decision was made with mid-90s memory and network constraints in mind and really is outdated. FWIW ircd even supports compression on links.

eaescob commented 1 month ago

I'm inclined to agree - we have AWAY burst as part of other networks and servers can handle that very well. What worries me is that I'm not sure I 100% understand the implications/use of MODE +a/-a. But I'm sure servers nowadays can handle a few more bytes.