Mon Jan 12 13:01:10 CET 2004 Jochen Eisinger <jochen@penguin-breeder.org> silc.client.1.0.1
authorJochen Eisinger <coffee@silcnet.org>
Mon, 12 Jan 2004 12:04:03 +0000 (12:04 +0000)
committerJochen Eisinger <coffee@silcnet.org>
Mon, 12 Jan 2004 12:04:03 +0000 (12:04 +0000)
* When resuming a session fails, notify the user that the session
  file needs to be removed eventually.  Affected files
  irssi/src/fe-common/silc/module-formats.[ch],
  irssi/src/silc/core/client_ops.c.

CHANGES
apps/irssi/src/fe-common/silc/module-formats.c
apps/irssi/src/fe-common/silc/module-formats.h
apps/irssi/src/silc/core/client_ops.c

diff --git a/CHANGES b/CHANGES
index 2fc9a8da448f280a9071e79b80dd5c22fb45ab41..3e9a8c816558a17e10c063eafdaa87accb4d7e6e 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,10 @@
+Mon Jan 12 13:01:10 CET 2004  Jochen Eisinger <jochen@penguin-breeder.org>
+
+       * When resuming a session fails, notify the user that the session
+         file needs to be removed eventually.  Affected files
+         irssi/src/fe-common/silc/module-formats.[ch],
+         irssi/src/silc/core/client_ops.c.
+
 Tue Jan 04 12:16:04 CET 2004  Jochen Eisinger <jochen@penguin-breeder.org>
 
        * Added DIST_SUBDIRS symbols to include all subdirs in distributions.
index 88736464ccd9e1d93a83560e6e44acc29a5b1cce..85a24c4d25c3807f73f87e20099bdfc2c23c18b1 100644 (file)
@@ -190,6 +190,7 @@ FORMAT_REC fecommon_silc_formats[] = {
        { "message_data", "{nick $0} sent \"{hilight $1}\" data message: cannot display", 2, { 0, 0 } },
        { "stats", "$[25]0: {hilight $1}", 2, { 0, 0 } },
        { "reattach", "Resuming old session on {hilight $0}, may take a while ...", 1, { 0 } },
+       { "reattach_failed", "Resuming session failed, you may want to remove {hilight $0} before the next connection attempt", 1, { 0 } },
 
        /* File transfer messages */
        { NULL, "FileTransfer", 0 },
index 27a94e9ed66cb34d2ec4de61f8c5fbca45bf04f0..2c4c064bfe21350e2236c07d8237a91a465368c7 100644 (file)
@@ -185,6 +185,7 @@ enum {
   SILCTXT_MESSAGE_DATA,
   SILCTXT_STATS,
   SILCTXT_REATTACH,
+  SILCTXT_REATTACH_FAILED,
 
   SILCTXT_FILL_5,
 
index d47dfc99f5cc3486074d052fd73a4390d419d6aa..3b5ca0ccb1a4726993b75b70149d68c5c3bd94f8 100644 (file)
@@ -1302,11 +1302,24 @@ void silc_connect(SilcClient client, SilcClientConnection conn,
     break;
 
   default:
-    server->connection_lost = TRUE;
-    if (server->conn)
-      server->conn->context = NULL;
-    server_disconnect(SERVER(server));
-    break;
+    {
+      char * file;
+
+      file = silc_get_session_filename(server);
+
+      if (silc_file_size(file) > 0)
+        printformat_module("fe-common/silc", server, NULL,
+                          MSGLEVEL_CRAP, SILCTXT_REATTACH_FAILED, file);
+
+      silc_free(file);
+
+      server->connection_lost = TRUE;
+      if (server->conn)
+        server->conn->context = NULL;
+      server_disconnect(SERVER(server));
+
+      break;
+    }
   }
 }