summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-07-24 09:22:01 +0200
committerPřemysl Eric Janouch <p@janouch.name>2021-07-24 09:27:49 +0200
commit027bf8666ed97ffaf35d7ffad08406488793c4b3 (patch)
treef4dd3e0a20de81d622f95c0e2911c64a4caf86d3
parent7c7e12d8d5e08cc5938b9d3bb8883048b6e2fd35 (diff)
downloadxK-027bf8666ed97ffaf35d7ffad08406488793c4b3.tar.gz
xK-027bf8666ed97ffaf35d7ffad08406488793c4b3.tar.xz
xK-027bf8666ed97ffaf35d7ffad08406488793c4b3.zip
degesch: never bump our own chanuser
With IRCv3.2 echo-message, each successfully sent message would move us to the front of the list used for chanuser autocomplete. Such behaviour seems useless. Also abandon the idea of bumping on other kinds of messages.
-rw-r--r--NEWS2
-rw-r--r--degesch.c7
2 files changed, 4 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index c5bc35a..fe89096 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,6 @@
1.3.0 (20xx-xx-xx)
- * degesch: made nick autocompletion ordered by the time of last action
+ * degesch: made nick autocompletion offer recent speakers first
1.2.0 (2021-07-08) "There Are Other Countries As Well"
diff --git a/degesch.c b/degesch.c
index c61fab6..0f8f22b 100644
--- a/degesch.c
+++ b/degesch.c
@@ -7270,12 +7270,11 @@ irc_handle_privmsg_text (struct server *s,
char *prefixes = irc_get_privmsg_prefix
(s, str_map_find (&s->irc_users, nickname), target);
- // Make autocomplete offer the last speakers first on partial matches
- // TODO: might want to do this on notices as well, and the behaviour
- // shouldn't change depending on whether CAP echo-message is enabled
+ // Make autocomplete offer recent speakers first on partial matches
+ // (note that freshly joined users also move to the front)
struct user *user;
struct channel_user *channel_user;
- if (buffer->channel
+ if (!irc_is_this_us (s, msg->prefix) && buffer->channel
&& (user = str_map_find (&s->irc_users, nickname))
&& (channel_user = irc_channel_get_user (buffer->channel, user)))
{