xC: deal with conflicts when renaming buffers
This commit is contained in:
parent
ef8f25d1dd
commit
b454920c81
2
NEWS
2
NEWS
|
@ -12,6 +12,8 @@ Unreleased
|
||||||
|
|
||||||
* xC: made it show WALLOPS messages, as PRIVMSG for the server buffer
|
* 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
|
* xD: implemented WALLOPS, choosing to make it target even non-operators
|
||||||
|
|
||||||
|
|
||||||
|
|
10
xC.c
10
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, user->nickname, NULL);
|
||||||
str_map_set (&s->irc_buffer_map, new_nickname, pm_buffer);
|
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);
|
buffer_rename (s->ctx, pm_buffer, x);
|
||||||
free (x);
|
free (x);
|
||||||
}
|
}
|
||||||
|
@ -8768,18 +8768,14 @@ server_rename (struct app_context *ctx, struct server *s, const char *new_name)
|
||||||
struct buffer *buffer;
|
struct buffer *buffer;
|
||||||
while ((buffer = str_map_iter_next (&iter)))
|
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;
|
char *x = NULL;
|
||||||
switch (buffer->type)
|
switch (buffer->type)
|
||||||
{
|
{
|
||||||
case BUFFER_PM:
|
case BUFFER_PM:
|
||||||
x = xstrdup_printf ("%s.%s", s->name, buffer->user->nickname);
|
x = irc_make_buffer_name (s, buffer->user->nickname);
|
||||||
break;
|
break;
|
||||||
case BUFFER_CHANNEL:
|
case BUFFER_CHANNEL:
|
||||||
x = xstrdup_printf ("%s.%s", s->name, buffer->channel->name);
|
x = irc_make_buffer_name (s, buffer->channel->name);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
hard_assert (!"unexpected type of server-related buffer");
|
hard_assert (!"unexpected type of server-related buffer");
|
||||||
|
|
Loading…
Reference in New Issue