about summary refs log tree commit diff stats
path: root/src/event
diff options
context:
space:
mode:
authorDebXWoody <stefan@debxwoody.de>2020-05-23 07:05:39 +0200
committerDebXWoody <stefan@debxwoody.de>2020-05-23 07:09:08 +0200
commitd3e23ff0300f94a1ff406099505e669e2088630f (patch)
tree47d567d5dff735f910385aec8c128c1ee1d64783 /src/event
parent86f0e0ea7033a27a83a5c24091ae1fd5b579296d (diff)
downloadprofani-tty-d3e23ff0300f94a1ff406099505e669e2088630f.tar.gz
Bugfix: Status with PGP shows offline in titlebar
There is code to redraw the ui, because the user may enter a passphase for the
private key. There was also a ui_init, which shouldn't be called, because it
will set the status to the initial state, which is 'offline' and 'no tls'.

Issue: #1327
Diffstat (limited to 'src/event')
-rw-r--r--src/event/server_events.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/event/server_events.c b/src/event/server_events.c
index c1f7b90e..21eac532 100644
--- a/src/event/server_events.c
+++ b/src/event/server_events.c
@@ -147,13 +147,12 @@ sv_ev_roster_received(void)
         }
         free(err_str);
 
-        // Redraw the screen after entry of the PGP secret key
+        // Redraw the screen after entry of the PGP secret key, but not init
         ProfWin *win = wins_get_current();
         char *theme = prefs_get_string(PREF_THEME);
         win_clear(win);
         theme_init(theme);
         prefs_free_string(theme);
-        ui_init();
         ui_resize();
         ui_show_roster();
     }
round-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
-- simple immediate-mode buttons

Button_handlers = {}

-- draw button and queue up event handlers
function button(name, params)
  love.graphics.setColor(params.color[1], params.color[2], params.color[3])
  love.graphics.rectangle('fill', params.x,params.y, params.w,params.h, 5,5)
  if params.icon then params.icon(params.x, params.y) end
  table.insert(Button_handlers, params)
end

-- process button event handlers
function propagate_to_button_handlers(x, y, mouse_button)
  for _,ev in ipairs(Button_handlers) do
    if x>ev.x and x<ev.x+ev.w and y>ev.y and y<ev.y+ev.h then
      if ev.onpress1 and mouse_button == 1 then ev.onpress1() end
    end
  end
end