[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Add option to ERC to make all connections use SSL.

From: Vibhav Pant
Subject: [PATCH] Add option to ERC to make all connections use SSL.
Date: Wed, 30 Jul 2014 14:49:52 +0530

Presently, ERC can connect to IRC netowrks using SSL via the function 'erc-tls'.
However, it can be confusing for new users to find this function, so I
have added a patch to erc.el which adds an option (erc-use-ssl) to
make all connections use SSL. Its value can be changed from
the customize group "erc". (The default value is nil).

diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 3bd9ff3..458892a 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -222,6 +222,11 @@ prompt you for it.")
   :group 'erc
   :type 'boolean)

+(defcustom erc-use-ssl nil
+  "If set to non-nill, use SSL to connect to all networks."
+  :group 'erc
+  :type 'boolean)
 (defcustom erc-hide-prompt nil
   "If non-nil, do not display the prompt for commands.

@@ -2145,10 +2150,10 @@ functions in here get called with the paramete

 (cl-defun erc (&key (server (erc-compute-server))
-                    (port   (erc-compute-port))
-                    (nick   (erc-compute-nick))
-                    password
-                    (full-name (erc-compute-full-name)))
+                   (port   (erc-compute-port))
+                   (nick   (erc-compute-nick))
+                   password
+                   (full-name (erc-compute-full-name)))
   "ERC is a powerful, modular, and extensible IRC client.
 This function is the main entry point for ERC.

@@ -2169,7 +2174,9 @@ then the server and full-name will be set to tho
 `erc-compute-port', `erc-compute-nick' and `erc-compute-full-name' wi
 be invoked for the values of the other parameters."
   (interactive (erc-select-read-args))
-  (erc-open server port nick full-name t password))
+  (let ((erc-server-connect-function (if erc-use-ssl 'erc-open-tls-st
+                                      'erc-server-connect-function)))
+    (erc-open server port nick full-name t password)))

 (defalias 'erc-select 'erc)

Vibhav Pant

Attachment: erc-ssl-option.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]