Timestamp:
2018-08-26T20:56:09Z (6 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
37437f2
Parents:
0b1448f
Message:

irc_im: fix away_reply_timeout getting reset too often

The hangouts plugin regularly sends redundant user status updates, since
that's how it works. The 'bee_irc_user_status' has some checks to not do
things on redundant changes, but they apply to other parts of the
function, not to the line that sets 'iu->away_reply_timeout = 0;'

This commit moves a bunch of the checks used for CAP_AWAY_NOTIFY to the
top of the function so it returns early if nothing was changed. It also
simplifies the flags check to plain equality, which should be good
enough.

As a side effect of this change, bee_irc_channel_update() won't be
called redundantly anymore. That function iterates over all channels,
so maybe in some workflows this improves performance? I doubt it.
There's also a risk that the redundant calls were actually needed.
I have no way to determine this, so i'll let future-dx deal with it.

Bug reported by needo, offending line pointed out by digitalcircuit,
thanks both!

(No files)

Note: See TracChangeset for help on using the changeset viewer.