aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2022-08-29 15:04:37 +0200
committerPřemysl Eric Janouch <p@janouch.name>2022-08-29 15:05:02 +0200
commitb454920c81cdb33914b008b716f2d5db7144ba56 (patch)
tree287abef5c6ade8795ff2e9842cda3e2aea56fa97
parentef8f25d1dd8905e56f8f20adf0bda4ecd4e19e40 (diff)
downloadxK-b454920c81cdb33914b008b716f2d5db7144ba56.tar.gz
xK-b454920c81cdb33914b008b716f2d5db7144ba56.tar.xz
xK-b454920c81cdb33914b008b716f2d5db7144ba56.zip
xC: deal with conflicts when renaming buffers
-rw-r--r--NEWS2
-rw-r--r--xC.c10
2 files changed, 5 insertions, 7 deletions
diff --git a/NEWS b/NEWS
index 207ec9b..e521b33 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,8 @@ Unreleased
* xC: made it show WALLOPS messages, as PRIVMSG for the server buffer
+ * xC: various bugfixes
+
* xD: implemented WALLOPS, choosing to make it target even non-operators
diff --git a/xC.c b/xC.c
index 5b8dda2..fe32773 100644
--- a/xC.c
+++ b/xC.c
@@ -7155,7 +7155,7 @@ irc_handle_nick (struct server *s, const struct irc_message *msg)
str_map_set (&s->irc_buffer_map, user->nickname, NULL);
str_map_set (&s->irc_buffer_map, new_nickname, pm_buffer);
- char *x = xstrdup_printf ("%s.%s", s->name, new_nickname);
+ char *x = irc_make_buffer_name (s, new_nickname);
buffer_rename (s->ctx, pm_buffer, x);
free (x);
}
@@ -8768,18 +8768,14 @@ server_rename (struct app_context *ctx, struct server *s, const char *new_name)
struct buffer *buffer;
while ((buffer = str_map_iter_next (&iter)))
{
- // TODO: creation of buffer names should be centralized -> replace
- // calls to buffer_rename() and manual setting of buffer names
- // with something like buffer_autorename() -- just mind the mess
- // in irc_handle_nick(), which can hopefully be simplified
char *x = NULL;
switch (buffer->type)
{
case BUFFER_PM:
- x = xstrdup_printf ("%s.%s", s->name, buffer->user->nickname);
+ x = irc_make_buffer_name (s, buffer->user->nickname);
break;
case BUFFER_CHANNEL:
- x = xstrdup_printf ("%s.%s", s->name, buffer->channel->name);
+ x = irc_make_buffer_name (s, buffer->channel->name);
break;
default:
hard_assert (!"unexpected type of server-related buffer");