Hello

Apparently this function was removed from Irssi[1]. I have created a
very simple patch (attached to this mail, created with quilt), which
does exactly the same thing as the now in-existent function but in the
silc-plugin itself.

I'm not sure if this is the right way to get the patch to the
appropriate people (or if they accept patches at all), so if I'm wrong
here: please tell me.

Best regards,
Stefan

[1] Diff rev. 4814:5125,servers-setup.c: http://tinyurl.com/y5goev4
Add function to replace the behaviour of server_setup_find_port which was 
removed from irssi on revision 5125. Fixes bug #577501.
--- a/apps/irssi/src/silc/core/client_ops.c
+++ b/apps/irssi/src/silc/core/client_ops.c
@@ -2790,6 +2790,15 @@
   silc_free(a);
 }
 
+/* helper function to emulate server_setup_find_port */
+static SERVER_SETUP_REC *silc_server_setup_find_port(const char *address,
+                                                    int port) {
+  SERVER_SETUP_REC *rec;
+
+  rec = server_setup_find(address, port, NULL);
+  return (rec == NULL || rec->port != port) ? NULL : rec;
+}
+
 /* Find authentication data by hostname and port. The hostname may be IP
    address as well.*/
 
@@ -2811,7 +2820,7 @@
 
   /* Check whether we find the password for this server in our
      configuration.  If it's set, always send it server. */
-  setup = server_setup_find_port(hostname, port);
+  setup = silc_server_setup_find_port(hostname, port);
   if (setup && setup->password) {
     completion(SILC_AUTH_PASSWORD, setup->password, strlen(setup->password),
               context);

Reply via email to