unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Add option to ERC to make all connections use SSL.
@ 2014-07-30  9:19 Vibhav Pant
  2014-07-30 20:22 ` Ted Zlatanov
  0 siblings, 1 reply; 12+ messages in thread
From: Vibhav Pant @ 2014-07-30  9:19 UTC (permalink / raw)
  To: emacs-devel@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1936 bytes --]

Hello,
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

 ;;;###autoload
 (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)))

 ;;;###autoload
 (defalias 'erc-select 'erc)

-- 
Vibhav Pant
vibhavp@gmail.com

[-- Attachment #2: erc-ssl-option.patch --]
[-- Type: text/x-patch, Size: 1530 bytes --]

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 parameters SERVER and NICK."
 
 ;;;###autoload
 (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 those values, whereas
 `erc-compute-port', `erc-compute-nick' and `erc-compute-full-name' will
 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-stream
+				       'erc-server-connect-function)))
+    (erc-open server port nick full-name t password))) 
 
 ;;;###autoload
 (defalias 'erc-select 'erc)

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-08-08  2:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-30  9:19 [PATCH] Add option to ERC to make all connections use SSL Vibhav Pant
2014-07-30 20:22 ` Ted Zlatanov
2014-07-31 16:46   ` Vibhav Pant
2014-07-31 20:40   ` Glenn Morris
2014-08-01 16:28     ` Vibhav Pant
2014-08-01 23:35       ` Ted Zlatanov
2014-08-02 17:47         ` Vibhav Pant
2014-08-02 19:11           ` Josh
2014-08-06 17:12             ` Ted Zlatanov
2014-08-08  2:09               ` Vibhav Pant
2014-08-03 14:39           ` John Zorn
2014-08-06 16:14             ` Josh

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).