Keep tray Away/Back actions enabled

This commit is contained in:
2026-03-25 17:54:45 -06:00
parent 8249be816a
commit baaea45d43
2 changed files with 6 additions and 8 deletions

View File

@@ -396,10 +396,14 @@ cmd_away (struct session *sess, char *tbuf, char *word[], char *word_eol[])
static int
cmd_back (struct session *sess, char *tbuf, char *word[], char *word_eol[])
{
if (sess->server->is_away)
if (sess->server->connected)
{
sess->server->p_set_back (sess->server);
}
else if (sess->server->reconnect_away)
{
sess->server->reconnect_away = FALSE;
}
else
{
PrintText (sess, _("Already marked back.\n"));

View File

@@ -964,7 +964,7 @@ tray_find_away_status (void)
{
serv = list->data;
if (serv->is_away || serv->reconnect_away)
if (serv->is_away || serv->reconnect_away || serv->last_away_reason)
away++;
else
back++;
@@ -1090,7 +1090,6 @@ tray_menu_populate (GtkWidget *menu)
{
GtkWidget *submenu;
GtkWidget *item;
int away_status;
/* ph may have an invalid context now */
zoitechat_set_context (ph, zoitechat_find_context (ph, NULL, NULL));
@@ -1113,13 +1112,8 @@ tray_menu_populate (GtkWidget *menu)
submenu = menu;
#endif
away_status = tray_find_away_status ();
item = tray_make_item (submenu, _("_Away"), tray_foreach_server, "away");
if (away_status == 1)
gtk_widget_set_sensitive (item, FALSE);
item = tray_make_item (submenu, _("_Back"), tray_foreach_server, "back");
if (away_status == 2)
gtk_widget_set_sensitive (item, FALSE);
menu_add_plugin_items (menu, "\x5$TRAY", NULL);