Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

weechat.el: Fix auto-reconnect when using SSL #79

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions weechat.el
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,14 @@ Return either a string, a function returning a string, or nil."
(setq weechat-reconnect-timer nil))
(unintern 'weechat-auto-reconnect-retries-left obarray))

(defun weechat-get-mode (modestr)
"Get connection mode from string"
(cond
((string= modestr "") nil)
((string= modestr "plain") 'plain)
((string= modestr "ssl") 'ssl)
(t modestr)))

;;;###autoload
(defun weechat-connect (&optional host port password mode force-disconnect)
"Connect to WeeChat.
Expand Down Expand Up @@ -639,11 +647,7 @@ and port number respectively."
;; The following ensures we always pass
;; a string.
(format "%s" weechat-mode-default))))
(cond
((string= modestr "") nil)
((string= modestr "plain") 'plain)
((string= modestr "ssl") 'ssl)
(t modestr)))))
(weechat-get-mode modestr))))
(setq weechat-last-port port)
(list
host port
Expand Down Expand Up @@ -715,7 +719,7 @@ and port number respectively."
host
port
(weechat-get-password host port)
(car weechat-mode-history)
(weechat-get-mode (car weechat-mode-history))
'force-disconnect)))))
t)))

Expand Down