Commit 415df2c1 authored by Pontus Freyhult's avatar Pontus Freyhult
Browse files

Allow for easy reconnect from dead sessions, fixes bug 1278.

parent d23b6917
2004-10-19 Pontus Freyhult <pont@soua.net>
Allow for easy relogin from dead sessions (bug 1278):
* command.el (lyskom-start-of-command): Possibly rerun
lyskom according to kom-relogin-behaviour.
* startup.el (kom-start-anew): Handle the case of
lyskom-default-user-name being an integer.
*vars.el.in (kom-relogin-behaviour): New variable.
(lyskom-default-user-name): Changed documentation.
* english-strings.el, swedish-strings.el:
(lyskom-message): Added resurrect-session.
(lyskom-custom-strings): Added kom-relogin-behaviour-doc
and kom-relogin-behaviour-tag.
* option-edit.el (lyskom-customize-buffer-format): Added
kom-relogin-behaviour.
(lyskom-custom-variables): Dito.
Clean up lyskom-default-password, enable password storing:
* english-strings.el, swedish-strings.el:
(lyskom-custom-strings): Added kom-remember-password-tag
......
......@@ -590,7 +590,11 @@ chosen according to this"
((and (not dead-ok)
(or (not lyskom-proc)
(memq (process-status lyskom-proc) '(closed signal exited nil))))
(lyskom-error "%s" (lyskom-get-string 'dead-session))))
(if (or (eq t kom-relogin-behaviour)
(and (eq 'ask kom-relogin-behaviour)
(lyskom-j-or-n-p (lyskom-get-string 'resurrect-session))))
(lyskom lyskom-server-name lyskom-pers-no)
(lyskom-error "%s" (lyskom-get-string 'dead-session)))))
(if (and lyskom-is-waiting
(listp lyskom-is-waiting))
......
......@@ -1254,6 +1254,7 @@ You should set it to a better value.\n")
(process-signal . "Signal from the process.")
(dead-session . "No active LysKOM session.")
(resurrect-session . "The LysKOM session is not active. Do you want to reconnect? ")
(not-lyskom-buffer . "This is not an active LysKOM session.")
(closed-connection . "
**************************************************
......@@ -3872,6 +3873,11 @@ up menus.")
(kom-show-week-number-doc . "\
The Time command shows week numbers if this is on.")
(kom-relogin-behaviour-doc . "\
This controls if the client will try to reattach when a command is given
in a disconnected session. On means the client tries to reattach
automatically, Off that it doesn't even ask.")
(kom-membership-default-placement-doc . "\
This controls where new memberships are placed. First means before
all existing memberships of the same priority. Last means after all
......@@ -4384,6 +4390,7 @@ up menus.")
(kom-ispell-dictionary-tag . "Spelling dictionary:")
(kom-show-week-number-tag . "Show week number:")
(kom-relogin-behaviour-tag . "Reattach automatically:")
(kom-membership-default-placement-tag . "Placement of new memberships:")
(kom-show-imported-importer-tag . "Show importer of imported messages:")
(kom-show-imported-envelope-sender-tag . "Show sender of imported messages:")
......
......@@ -74,6 +74,7 @@
[kom-auto-confirm-new-conferences]
"\n"
[kom-idle-hide]
[kom-relogin-behaviour]
[kom-remember-password]
[kom-show-where-and-what]
[kom-show-since-and-when]
......@@ -795,6 +796,11 @@ All key bindings:
(nameday nil :tag specific-namedays))))
(kom-show-week-number (toggle (on off)))
(kom-relogin-behaviour (choice ((const (off nil))
(const (ask ask))
(const (on t)))))
(kom-membership-default-placement (choice ((const (last last))
(const (first first))
(number nil
......
......@@ -541,9 +541,11 @@ shown to other users."
lyskom-default-user-name)
;; This is nil if we can't find a unique match.
(setq new-me
(conf-z-info->conf-no
(if (integerp lyskom-default-user-name)
lyskom-default-user-name
(conf-z-info->conf-no
(lyskom-lookup-conf-by-name lyskom-default-user-name
'(pers)))))
'(pers))))))
(if new-me
nil
(let ((name nil))
......
......@@ -1293,6 +1293,7 @@ Du b
LysKOM-sessionen onormalt stngd.
Felmeddelande: %#1s**************************************************")
(dead-session . "LysKOM-sessionen r inte aktiv.")
(resurrect-session . "LysKOM-sessionen har kopplats ner, vill du ansluta igen? ")
(not-lyskom-buffer . "Detta r inte en aktiv LysKOM-session.")
(error-not-found . "Fel nummer %#1d. Ingen klartextfrklaring finns.")
......@@ -3987,6 +3988,11 @@ ta fram menyer.")
Se tiden visar veckonummer om detta r pslaget. Annars visas inte
veckonummer.")
(kom-relogin-behaviour-doc . "\
Denna instllning styr om klienten ska frska teransluta om ett
kommando ges i en nedkopplad session. P betyder att det sker
automatiskt, av att klienten inte frgar om man vill teransluta.")
(kom-membership-default-placement-doc . "\
Denna instllning styr var nya medlemskap hamnar. Frst betyder att nya
medlemskap hamnar fre gamla med samma prioritet. Sist betyder att nya
......@@ -4495,8 +4501,9 @@ ta fram menyer.")
(kom-default-language-tag . "Sprklista:")
(kom-ispell-dictionary-tag . "Ordlista:")
(kom-show-namedays-tag . "Visa dagens namn:")
(kom-show-week-number-tag . "Visa veckonummer:")
(kom-relogin-behaviour-tag . "teranslut automatiskt:")
(kom-membership-default-placement-tag . "Placering av nya medlemskap:")
(kom-show-imported-importer-tag . "Visa importr av importerade inlgg:")
(kom-show-imported-envelope-sender-tag . "Visa avsndare av importerade inlgg:")
......
......@@ -1720,6 +1720,14 @@ command is accepted from the keyboard. Unlike `lyskom-login-hook' it
can be stored in the server."
server)
(def-kom-var kom-relogin-behaviour 'ask
"**Controls how to behave when commands are issued in dead sessions.
When this is set to `t', the client will try to login automatically.
When set to 'ask, the client will ask whatever the user wants to reattach.
When set to nil, the client will not attempt to reattach."
server)
(def-kom-var kom-remember-password nil
"**Controls whatever to store the password in the session buffer.
......@@ -4474,8 +4482,10 @@ setting this variable you may set the environment variable `KOMSERVER'.")
(def-kom-var lyskom-default-user-name nil
"**Default LysKOM user name.
The value of this variable must be a string or `nil'. Instead of
setting this variable you may set the environment variable `KOMNAME'."
The value of this variable must be a string, integer or `nil'. If it's an
integer, it must be the conference number of the user to login as. Instead of
setting this variable you may set the environment variable `KOMNAME' to the
username to login as."
local)
(defvar kom-default-password nil
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment