Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
64d38296ad
|
||
|
|
8d16434945
|
||
|
|
baf5ff0d25
|
||
|
|
9472f960fd
|
||
|
|
7a21781343
|
+1
-1
Submodule liberty updated: 022cce71fa...c6a8d65bbc
@@ -3,19 +3,18 @@ module janouch.name/xK/xA
|
||||
go 1.26
|
||||
|
||||
require (
|
||||
fyne.io/fyne/v2 v2.8.0
|
||||
fyne.io/fyne/v2 v2.8.1
|
||||
github.com/ebitengine/oto/v3 v3.4.0
|
||||
)
|
||||
|
||||
require (
|
||||
fyne.io/systray v1.12.2 // indirect
|
||||
fyne.io/systray v1.12.3-0.20260810170012-af4e8e793ec4 // indirect
|
||||
github.com/BurntSushi/toml v1.6.0 // indirect
|
||||
github.com/FyshOS/fancyfs v0.0.1 // indirect
|
||||
github.com/anthonynsimon/bild v0.16.1 // indirect
|
||||
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/ebitengine/purego v0.10.1 // indirect
|
||||
github.com/fredbi/uri v1.1.1 // indirect
|
||||
github.com/fsnotify/fsnotify v1.10.1 // indirect
|
||||
github.com/fyne-io/gl-js v0.2.1-0.20260315212741-029c47fd27e8 // indirect
|
||||
github.com/fyne-io/glfw-js v0.4.0 // indirect
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
fyne.io/fyne/v2 v2.8.0 h1:KNUdIk1eKsXSPy/wU6MdiR1hppAPvyzbjPbtJ8h6EUQ=
|
||||
fyne.io/fyne/v2 v2.8.0/go.mod h1:tLJK7CVtUBOnMiSDR+J88t/quiGuEhwGs09tIVM1RXg=
|
||||
fyne.io/systray v1.12.2 h1:Y8DZxgLHsVQt6rY9Zrkkg+j67S7vv/1F2viOWKPpVeA=
|
||||
fyne.io/systray v1.12.2/go.mod h1:RVwqP9nYMo7h5zViCBHri2FgjXF7H2cub7MAq4NSoLs=
|
||||
fyne.io/fyne/v2 v2.8.1 h1:EztGuE2W3Qhd0cWVmU+h5rkzNezUD1To6UqsoLQYUIM=
|
||||
fyne.io/fyne/v2 v2.8.1/go.mod h1:kpeuFrClm0fiAgJYr2soTfwKMT5rzNcSKzmgGjxvHOY=
|
||||
fyne.io/systray v1.12.3-0.20260810170012-af4e8e793ec4 h1:149/+Wa5EsLLXfyj2pdTmvnQf2VIlgCIwSjcCTHYhIo=
|
||||
fyne.io/systray v1.12.3-0.20260810170012-af4e8e793ec4/go.mod h1:RVwqP9nYMo7h5zViCBHri2FgjXF7H2cub7MAq4NSoLs=
|
||||
github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk=
|
||||
github.com/BurntSushi/toml v1.6.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
|
||||
github.com/FyshOS/fancyfs v0.0.1 h1:kgvm7VvwOMLkYTqSflplp62SlMVWQ2uAoHw9CXwXHYg=
|
||||
@@ -16,10 +16,6 @@ github.com/ebitengine/oto/v3 v3.4.0 h1:br0PgASsEWaoWn38b2Goe7m1GKFYfNgnsjSd5Gg+/
|
||||
github.com/ebitengine/oto/v3 v3.4.0/go.mod h1:IOleLVD0m+CMak3mRVwsYY8vTctQgOM0iiL6S7Ar7eI=
|
||||
github.com/ebitengine/purego v0.10.1 h1:dewVBCBT2GaMu1SrNTYxQhgQBethzfhiwvZiLGP/qyY=
|
||||
github.com/ebitengine/purego v0.10.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
|
||||
github.com/felixge/fgprof v0.9.3 h1:VvyZxILNuCiUCSXtPtYmmtGvb65nqXh2QFWc0Wpf2/g=
|
||||
github.com/felixge/fgprof v0.9.3/go.mod h1:RdbpDgzqYVh/T9fPELJyV7EYJuHB55UTEULNun8eiPw=
|
||||
github.com/fredbi/uri v1.1.1 h1:xZHJC08GZNIUhbP5ImTHnt5Ya0T8FI2VAwI/37kh2Ko=
|
||||
github.com/fredbi/uri v1.1.1/go.mod h1:4+DZQ5zBjEwQCDmXW5JdIjz0PUA+yJbvtBv+u+adr5o=
|
||||
github.com/fsnotify/fsnotify v1.10.1 h1:b0/UzAf9yR5rhf3RPm9gf3ehBPpf0oZKIjtpKrx59Ho=
|
||||
github.com/fsnotify/fsnotify v1.10.1/go.mod h1:TLheqan6HD6GBK6PrDWyDPBaEV8LspOxvPSjC+bVfgo=
|
||||
github.com/fyne-io/gl-js v0.2.1-0.20260315212741-029c47fd27e8 h1:0kdPD/GEntpWmZEK5Zu/xE6Tr37jYCVDf9QP8lA/QK8=
|
||||
@@ -42,8 +38,6 @@ github.com/go-text/typesetting-utils v0.0.0-20260223113751-2d88ac90dae3 h1:drBZz
|
||||
github.com/go-text/typesetting-utils v0.0.0-20260223113751-2d88ac90dae3/go.mod h1:3/62I4La/HBRX9TcTpBj4eipLiwzf+vhI+7whTc9V7o=
|
||||
github.com/godbus/dbus/v5 v5.2.2 h1:TUR3TgtSVDmjiXOgAAyaZbYmIeP3DPkld3jgKGV8mXQ=
|
||||
github.com/godbus/dbus/v5 v5.2.2/go.mod h1:3AAv2+hPq5rdnr5txxxRwiGjPXamgoIHgz9FPBfOp3c=
|
||||
github.com/google/pprof v0.0.0-20211214055906-6f57359322fd h1:1FjCyPC+syAzJ5/2S8fqdZK1R22vvA0J7JZKcuOIQ7Y=
|
||||
github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg=
|
||||
github.com/hack-pad/go-indexeddb v0.3.2 h1:DTqeJJYc1usa45Q5r52t01KhvlSN02+Oq+tQbSBI91A=
|
||||
github.com/hack-pad/go-indexeddb v0.3.2/go.mod h1:QvfTevpDVlkfomY498LhstjwbPW6QC4VC/lxYb0Kom0=
|
||||
github.com/hack-pad/safejs v0.1.1 h1:d5qPO0iQ7h2oVtpzGnLExE+Wn9AtytxIfltcS2b9KD8=
|
||||
@@ -62,8 +56,6 @@ github.com/nicksnyder/go-i18n/v2 v2.6.1 h1:JDEJraFsQE17Dut9HFDHzCoAWGEQJom5s0TRd
|
||||
github.com/nicksnyder/go-i18n/v2 v2.6.1/go.mod h1:Vee0/9RD3Quc/NmwEjzzD7VTZ+Ir7QbXocrkhOzmUKA=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
|
||||
github.com/pkg/profile v1.7.0 h1:hnbDkaNWPCLMO9wGLdBFTIZvzDrDfBM2072E1S9gJkA=
|
||||
github.com/pkg/profile v1.7.0/go.mod h1:8Uer0jas47ZQMJ7VD+OHknK4YDY07LPUC6dEvqDjvNo=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/rymdport/portal v0.4.2 h1:7jKRSemwlTyVHHrTGgQg7gmNPJs88xkbKcIL3NlcmSU=
|
||||
|
||||
@@ -5079,11 +5079,11 @@ static void
|
||||
buffer_rename (struct app_context *ctx,
|
||||
struct buffer *buffer, const char *new_name)
|
||||
{
|
||||
struct buffer *collision = str_map_find (&ctx->buffers_by_name, new_name);
|
||||
if (collision == buffer)
|
||||
if (!strcmp (buffer->name, new_name))
|
||||
return;
|
||||
|
||||
hard_assert (!collision);
|
||||
struct buffer *collision = str_map_find (&ctx->buffers_by_name, new_name);
|
||||
hard_assert (!collision || collision == buffer);
|
||||
|
||||
relay_prepare_buffer_rename (ctx, buffer, new_name);
|
||||
relay_broadcast (ctx);
|
||||
@@ -5222,7 +5222,8 @@ init_global_buffer (struct app_context *ctx)
|
||||
// --- Users, channels ---------------------------------------------------------
|
||||
|
||||
static char *
|
||||
irc_make_buffer_name (struct server *s, const char *target)
|
||||
irc_make_buffer_name (struct server *s, const char *target,
|
||||
struct buffer *ignore)
|
||||
{
|
||||
if (!target)
|
||||
return xstrdup (s->name);
|
||||
@@ -5232,7 +5233,7 @@ irc_make_buffer_name (struct server *s, const char *target)
|
||||
free (target_utf8);
|
||||
|
||||
struct buffer *conflict = buffer_by_name (s->ctx, name);
|
||||
if (!conflict)
|
||||
if (!conflict || conflict == ignore)
|
||||
return name;
|
||||
|
||||
hard_assert (conflict->server == s);
|
||||
@@ -5287,7 +5288,7 @@ irc_get_or_make_user_buffer (struct server *s, const char *nickname)
|
||||
|
||||
// Open a new buffer for the user
|
||||
buffer = buffer_new (s->ctx->input,
|
||||
BUFFER_PM, irc_make_buffer_name (s, nickname));
|
||||
BUFFER_PM, irc_make_buffer_name (s, nickname, NULL));
|
||||
buffer->server = s;
|
||||
buffer->user = user;
|
||||
str_map_set (&s->irc_buffer_map, user->nickname, buffer);
|
||||
@@ -7558,7 +7559,7 @@ irc_handle_join (struct server *s, const struct irc_message *msg)
|
||||
return;
|
||||
|
||||
buffer = buffer_new (s->ctx->input,
|
||||
BUFFER_CHANNEL, irc_make_buffer_name (s, channel_name));
|
||||
BUFFER_CHANNEL, irc_make_buffer_name (s, channel_name, NULL));
|
||||
buffer->server = s;
|
||||
buffer->channel = channel =
|
||||
irc_make_channel (s, xstrdup (channel_name));
|
||||
@@ -7716,7 +7717,7 @@ irc_handle_nick (struct server *s, const struct irc_message *msg)
|
||||
bool lexicographically_different =
|
||||
!!irc_server_strcmp (s, user->nickname, new_nickname);
|
||||
|
||||
// What the fuck, someone renamed themselves to ourselves
|
||||
// Someone has renamed themselves to ourselves, a true fuck-up.
|
||||
// TODO: probably log a message and force a reconnect
|
||||
if (lexicographically_different
|
||||
&& !irc_server_strcmp (s, new_nickname, s->irc_user->nickname))
|
||||
@@ -7774,7 +7775,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 = irc_make_buffer_name (s, new_nickname);
|
||||
char *x = irc_make_buffer_name (s, new_nickname, pm_buffer);
|
||||
buffer_rename (s->ctx, pm_buffer, x);
|
||||
free (x);
|
||||
}
|
||||
@@ -9322,11 +9323,14 @@ validate_server_name (const char *name)
|
||||
}
|
||||
|
||||
static const char *
|
||||
check_server_name_for_addition (struct app_context *ctx, const char *name)
|
||||
check_server_name_for_addition (struct app_context *ctx, const char *name,
|
||||
struct server *ignore)
|
||||
{
|
||||
if (!strcasecmp_ascii (name, ctx->global_buffer->name))
|
||||
return "name collides with the global buffer";
|
||||
if (str_map_find (&ctx->servers, name))
|
||||
|
||||
struct server *collision = str_map_find (&ctx->servers, name);
|
||||
if (collision && collision != ignore)
|
||||
return "server already exists";
|
||||
if (!validate_server_name (name))
|
||||
return "invalid server name";
|
||||
@@ -9350,7 +9354,7 @@ server_add (struct app_context *ctx,
|
||||
|
||||
// Add a buffer and activate it
|
||||
struct buffer *buffer = s->buffer = buffer_new (ctx->input,
|
||||
BUFFER_SERVER, irc_make_buffer_name (s, NULL));
|
||||
BUFFER_SERVER, irc_make_buffer_name (s, NULL, NULL));
|
||||
buffer->server = s;
|
||||
|
||||
buffer_add (ctx, buffer);
|
||||
@@ -9420,7 +9424,8 @@ server_remove (struct app_context *ctx, struct server *s)
|
||||
static void
|
||||
server_rename (struct app_context *ctx, struct server *s, const char *new_name)
|
||||
{
|
||||
hard_assert (!str_map_find (&ctx->servers, new_name));
|
||||
struct server *collision = str_map_find (&ctx->servers, new_name);
|
||||
hard_assert (!collision || collision == s);
|
||||
|
||||
relay_prepare_server_rename (ctx, s, new_name);
|
||||
relay_broadcast (ctx);
|
||||
@@ -9442,10 +9447,10 @@ server_rename (struct app_context *ctx, struct server *s, const char *new_name)
|
||||
switch (buffer->type)
|
||||
{
|
||||
case BUFFER_PM:
|
||||
x = irc_make_buffer_name (s, buffer->user->nickname);
|
||||
x = irc_make_buffer_name (s, buffer->user->nickname, buffer);
|
||||
break;
|
||||
case BUFFER_CHANNEL:
|
||||
x = irc_make_buffer_name (s, buffer->channel->name);
|
||||
x = irc_make_buffer_name (s, buffer->channel->name, buffer);
|
||||
break;
|
||||
default:
|
||||
hard_assert (!"unexpected type of server-related buffer");
|
||||
@@ -12752,7 +12757,7 @@ handle_server_add (struct handler_args *a)
|
||||
struct app_context *ctx = a->ctx;
|
||||
char *name = cut_word (&a->arguments);
|
||||
const char *err;
|
||||
if ((err = check_server_name_for_addition (ctx, name)))
|
||||
if ((err = check_server_name_for_addition (ctx, name, NULL)))
|
||||
log_global_error (ctx, "Cannot create server `#s': #s", name, err);
|
||||
else
|
||||
{
|
||||
@@ -12798,7 +12803,7 @@ handle_server_rename (struct handler_args *a)
|
||||
if (!(s = str_map_find (&ctx->servers, old_name)))
|
||||
log_global_error (ctx, "/#s: #s: #s",
|
||||
"server", "no such server", old_name);
|
||||
else if ((err = check_server_name_for_addition (ctx, new_name)))
|
||||
else if ((err = check_server_name_for_addition (ctx, new_name, s)))
|
||||
log_global_error (ctx,
|
||||
"Cannot rename server to `#s': #s", new_name, err);
|
||||
else
|
||||
@@ -14809,7 +14814,7 @@ load_servers (struct app_context *ctx)
|
||||
if (subtree->type != CONFIG_ITEM_OBJECT)
|
||||
log_global_error (ctx, "Error in configuration: "
|
||||
"ignoring server `#s' as it's not an object", name);
|
||||
else if ((err = check_server_name_for_addition (ctx, name)))
|
||||
else if ((err = check_server_name_for_addition (ctx, name, NULL)))
|
||||
log_global_error (ctx, "Cannot load server `#s': #s", name, err);
|
||||
else
|
||||
server_add (ctx, name, subtree);
|
||||
|
||||
@@ -1591,6 +1591,9 @@ relay_process_buffer_event (struct relay_event_message *m)
|
||||
b->highlighted = m->data.buffer_stats.highlighted;
|
||||
break;
|
||||
case RELAY_EVENT_BUFFER_RENAME:
|
||||
// XXX: If this merges buffers, we should replace the original one
|
||||
// with the new one's contents. Either one can be current or last.
|
||||
// In practice, this situation should not occur.
|
||||
str_map_set (&g.buffers_by_name, b->buffer_name, NULL);
|
||||
cstr_set (&b->buffer_name, xstrdup (m->data.buffer_rename.new.str));
|
||||
str_map_set (&g.buffers_by_name, b->buffer_name, b);
|
||||
@@ -3642,9 +3645,14 @@ app_open_last_link (void)
|
||||
|
||||
struct buffer *b = g.buffer_current;
|
||||
LIST_FOR_EACH_REVERSED (struct buffer_line, line, b->lines_tail)
|
||||
{
|
||||
if (!buffer_line_is_visible (b, line))
|
||||
continue;
|
||||
|
||||
LIST_FOR_EACH (struct buffer_line_item, item, line->items)
|
||||
if (app_open_link (item))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user