<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>DLog.h</filename>
    </added>
    <added>
      <filename>DLog.m</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -63,7 +63,7 @@ NSString *FiSHAvoidEncCommand = @&quot;disableEnc&quot;;
 {
    if (self = [super init])
    {
-//      NSLog(@&quot;Loading FiSHy.&quot;);
+      DLog(@&quot;Loading FiSHy.&quot;);
       
       keyExchanger_ = [[FiSHKeyExchanger alloc] initWithDelegate:self];
       urlToConnectionCache_ = [[NSMutableDictionary alloc] init];
@@ -166,7 +166,7 @@ NSString *FiSHAvoidEncCommand = @&quot;disableEnc&quot;;
          [msgAttributes setObject:[NSNumber numberWithInt:FiSHCypherTextCut] forKey:@&quot;FiSHyResult&quot;];
          break;
       default:
-         NSLog(@&quot;Unexpected/unknown blowfish result.&quot;);
+         DLog(@&quot;Unexpected/unknown blowfish result.&quot;);
    }
 }
 
@@ -226,7 +226,7 @@ bail:
 {
    if (![aView isKindOfClass:NSClassFromString(@&quot;JVDirectChatPanel&quot;)])
    {
-      NSLog(@&quot;Unexpected view class encountered.&quot;);
+      DLog(@&quot;Unexpected view class encountered.&quot;);
       return;
    }
    // It's now safe to typecast view, to prevent compiler-warnings later.
@@ -237,7 +237,7 @@ bail:
    // The following checks for attributes regarding messages from the local user.
    if ([message senderIsLocalUser])
    {
-      if ([[[message attributes] objectForKey:@&quot;shouldEncrypt&quot;] boolValue] &amp;&amp; [encPrefs_ preferenceForService:nil account:targetName] == FiSHEncPrefAvoidEncrypted)
+      if ([[message objectForKey:@&quot;shouldEncrypt&quot;] boolValue] &amp;&amp; [encPrefs_ preferenceForService:nil account:targetName] == FiSHEncPrefAvoidEncrypted)
       {
          NSTextStorage *body = [message body];
          [body appendAttributedString:[[[NSAttributedString alloc] initWithString:FiSHEncryptedMessageMarker 
@@ -249,7 +249,7 @@ bail:
    } else
    {
       // The following checks for attributes regarding messages not from the local user.
-      BOOL decrypted = [[[message attributes] objectForKey:@&quot;decrypted&quot;] boolValue];
+      BOOL decrypted = [[message objectForKey:@&quot;decrypted&quot;] boolValue];
       FiSHEncPrefKey encPref = [encPrefs_ preferenceForService:nil account:targetName];
       NSString *errorMsg = nil;
       if (decrypted &amp;&amp; encPref == FiSHEncPrefAvoidEncrypted)
@@ -276,7 +276,7 @@ bail:
 {
    if (![aView isKindOfClass:NSClassFromString(@&quot;JVDirectChatPanel&quot;)])
    {
-      NSLog(@&quot;Unexpected view class encountered.&quot;);
+      DLog(@&quot;Unexpected view class encountered.&quot;);
       return;
    }
    // It's now safe to typecast view, to prevent compiler-warnings later.
@@ -288,18 +288,10 @@ bail:
    // TODO: Handle service.
    if ([encPrefs_ preferenceForService:nil account:targetName] == FiSHEncPrefPreferEncrypted)
    {
-      NSMutableDictionary *attributes = [[message attributes] mutableCopy];
-      if (!attributes)
-         attributes = [NSMutableDictionary dictionary];
-      [attributes setObject:[NSNumber numberWithBool:YES] forKey:@&quot;shouldEncrypt&quot;];
-      [message setAttributes:attributes];
+      [message setObject:[NSNumber numberWithBool:YES] forKey:@&quot;shouldEncrypt&quot;];
    } else if ([encPrefs_ preferenceForService:nil account:targetName] == FiSHEncPrefAvoidEncrypted)
    {
-      NSMutableDictionary *attributes = [[message attributes] mutableCopy];
-      if (!attributes)
-         attributes = [NSMutableDictionary dictionary];
-      [attributes setObject:[NSNumber numberWithBool:YES] forKey:@&quot;sendUnencrypted&quot;];
-      [message setAttributes:attributes];
+      [message setObject:[NSNumber numberWithBool:YES] forKey:@&quot;sendUnencrypted&quot;];
    }
 }
 
@@ -321,7 +313,7 @@ bail:
    // So check first for the correct class-membership before proceeding.
    if (![aView isKindOfClass:NSClassFromString(@&quot;JVDirectChatPanel&quot;)])
    {
-      NSLog(@&quot;Unexpected view class encountered.&quot;);
+      DLog(@&quot;Unexpected view class encountered.&quot;);
       return NO;
    }
    // It's now safe to typecast view, to prevent compiler-warnings later.
@@ -336,7 +328,7 @@ bail:
       else
       {
          // TODO: Put out notice to user.
-         NSLog(@&quot;No argument provided to /keyx, aborting.&quot;);
+         DLog(@&quot;No argument provided to /keyx, aborting.&quot;);
          return NO;
       }
    }
@@ -344,7 +336,7 @@ bail:
    if ([argumentString hasPrefix:@&quot;#&quot;] || [argumentString hasPrefix:@&quot;&amp;&quot;])
    {
       // TODO: Put out notice to user.
-      NSLog(@&quot;Key exchange is only supported for nicknames, not for channels, aborting.&quot;);
+      DLog(@&quot;Key exchange is only supported for nicknames, not for channels, aborting.&quot;);
       return NO;
    }
    
@@ -362,7 +354,7 @@ bail:
    if (!argumentString || [argumentString length] &lt;= 0)
    {
       // TODO: Put out notice to user.
-      NSLog(@&quot;No arguments provided to /setkey, aborting.&quot;);
+      DLog(@&quot;No arguments provided to /setkey, aborting.&quot;);
       return NO;
    }
 
@@ -371,7 +363,7 @@ bail:
    // So check first for the correct class-membership before proceeding.
    if (![aView isKindOfClass:NSClassFromString(@&quot;JVDirectChatPanel&quot;)])
    {
-      NSLog(@&quot;Unexpected view class encountered.&quot;);
+      DLog(@&quot;Unexpected view class encountered.&quot;);
       return NO;
    }
    // It's now safe to typecast view, to prevent compiler-warnings later.
@@ -390,7 +382,7 @@ bail:
          account = [[view target] name];
       else {
          // TODO: Put out notice to user.
-         NSLog(@&quot;SetKey expects exactly 2 arguments, aborting.&quot;);
+         DLog(@&quot;SetKey expects exactly 2 arguments, aborting.&quot;);
          return NO;
       }
       secret = [argumentList objectAtIndex:0];
@@ -401,7 +393,7 @@ bail:
    } else
    {
       // TODO: Put out notice to user.
-      NSLog(@&quot;SetKey expects exactly 2 arguments, aborting.&quot;);
+      DLog(@&quot;SetKey expects exactly 2 arguments, aborting.&quot;);
       return NO;
    }
    
@@ -425,14 +417,14 @@ bail:
 {
    if (![aView isKindOfClass:NSClassFromString(@&quot;JVDirectChatPanel&quot;)])
    {
-      NSLog(@&quot;Unexpected view class encountered.&quot;);
+      DLog(@&quot;Unexpected view class encountered.&quot;);
       return NO;
    }
    // It's now safe to typecast view, to prevent compiler-warnings later.
    JVDirectChatPanel *view = (JVDirectChatPanel *)aView;
    
    JVMutableChatMessage *msg = [[[NSClassFromString(@&quot;JVMutableChatMessage&quot;) alloc] initWithText:arguments sender:[connection localUser]] autorelease];
-   [msg setAttributes:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES] forKey:@&quot;sendUnencrypted&quot;]];
+   [msg setObject:[NSNumber numberWithBool:YES] forKey:@&quot;sendUnencrypted&quot;];
    [view echoSentMessageToDisplay:msg];
    [view sendMessage:msg];
    
@@ -443,7 +435,7 @@ bail:
 {
    if (![aView isKindOfClass:NSClassFromString(@&quot;JVDirectChatPanel&quot;)])
    {
-      NSLog(@&quot;Unexpected view class encountered.&quot;);
+      DLog(@&quot;Unexpected view class encountered.&quot;);
       return NO;
    }
    // It's now safe to typecast view, to prevent compiler-warnings later.
@@ -460,7 +452,7 @@ bail:
    } else
    {
       // TODO: Put out notice to user.
-      NSLog(@&quot;Command expects exactly 1 argument&quot;);
+      DLog(@&quot;Command expects exactly 1 argument&quot;);
       return NO;
    }
    
@@ -491,7 +483,7 @@ bail:
    // So check first for the correct class-membership before proceeding.
    if (![aView isKindOfClass:NSClassFromString(@&quot;JVDirectChatPanel&quot;)])
    {
-      NSLog(@&quot;Unexpected view class encountered.&quot;);
+      DLog(@&quot;Unexpected view class encountered.&quot;);
       return NO;
    }
    // It's now safe to typecast view, to prevent compiler-warnings later.</diff>
      <filename>FiSHController.m</filename>
    </modified>
    <modified>
      <diff>@@ -40,6 +40,8 @@ const NSString *FiSHKeyExchangeInfoRemoveOldTempKeyPairTimerKey = @&quot;FiSHKeyExcha
 - (NSDictionary *)temporaryKeyExchangeInfosForNickname:(NSString *)nickname onConnection:(id)connection;
 - (void)removeTemporaryKeyExchangeInfosForNickName:(NSString *)nickname onConnection:(id)connection;
 
+- (void)handleKeyExchangeTimeoutForNickname:(NSString *)nickname onConnection:(id)connection;
+
 - (void)handleFiSHKeyExchangeRequestFrom:(NSString *)nickname on:(id)connection withRemotePublicKeyData:(NSString *)remotePublicKeyData;
 - (void)handleFiSHKeyExchangeResponseFrom:(NSString *)nickname on:(id)connection withRemotePublicKeyData:(NSString *)remotePublicKeyData;
 @end
@@ -112,7 +114,7 @@ const NSString *FiSHKeyExchangeInfoRemoveOldTempKeyPairTimerKey = @&quot;FiSHKeyExcha
    if ([message hasStringPrefix:HCKFiSHKeyExchangeRequest encoding:NSASCIIStringEncoding])
    {
       // The notice is interpreted as a FiSH key exchange request, when its message body starts with &quot;DH1080_INIT &quot;.
-      NSLog(@&quot;Got remote FiSH DH1080 key exchange request.&quot;);
+      DLog(@&quot;Got remote FiSH DH1080 key exchange request.&quot;);
 
       NSString *remotePublicKey = [[NSString alloc] initWithData:[message subDataFromIndex:[HCKFiSHKeyExchangeRequest length]] encoding:NSASCIIStringEncoding];
       
@@ -124,7 +126,7 @@ const NSString *FiSHKeyExchangeInfoRemoveOldTempKeyPairTimerKey = @&quot;FiSHKeyExcha
    } else if ([message hasStringPrefix:HCKFiSHKeyExchangeResponse encoding:NSASCIIStringEncoding])
    {
       // The notice is interpreted as a FiSH key exchange response, when its message body starts with &quot;DH1080_FINISH &quot;.
-      NSLog(@&quot;Got FiSH DH1080 key exchange response.&quot;);
+      DLog(@&quot;Got FiSH DH1080 key exchange response.&quot;);
 
       NSString *remotePublicKey = [[NSString alloc] initWithData:[message subDataFromIndex:[HCKFiSHKeyExchangeResponse length]] encoding:NSASCIIStringEncoding];
       
@@ -154,10 +156,10 @@ const NSString *FiSHKeyExchangeInfoRemoveOldTempKeyPairTimerKey = @&quot;FiSHKeyExcha
    }
    
    // Build an invocation, which deletes the to be added key pair.
-   NSMethodSignature *methodSig = [self methodSignatureForSelector:@selector(removeTemporaryKeyExchangeInfosForNickName:onConnection:)];
+   NSMethodSignature *methodSig = [self methodSignatureForSelector:@selector(handleKeyExchangeTimeoutForNickname:onConnection:)];
    NSInvocation *removeOldTempKeyExchangeInfoInvocation = [NSInvocation invocationWithMethodSignature:methodSig];
    [removeOldTempKeyExchangeInfoInvocation setTarget:self];
-   [removeOldTempKeyExchangeInfoInvocation setSelector:@selector(removeTemporaryKeyExchangeInfosForNickName:onConnection:)];
+   [removeOldTempKeyExchangeInfoInvocation setSelector:@selector(handleKeyExchangeTimeoutForNickname:onConnection:)];
    [removeOldTempKeyExchangeInfoInvocation setArgument:&amp;nickname atIndex:2];
    [removeOldTempKeyExchangeInfoInvocation setArgument:&amp;connection atIndex:3];
    
@@ -186,7 +188,7 @@ const NSString *FiSHKeyExchangeInfoRemoveOldTempKeyPairTimerKey = @&quot;FiSHKeyExcha
 
 - (void)removeTemporaryKeyExchangeInfosForNickName:(NSString *)nickname onConnection:(id)connection;
 {
-   NSLog(@&quot;Removing temporary key exchange info for %@ on %@&quot;, nickname, connection);
+   DLog(@&quot;Removing temporary key exchange info for %@ on %@&quot;, nickname, connection);
    
    [temporaryKeyExchangeInfosLock_ lock];
    // First, invalidate the timer set up to remove this tempo key pair after some time has passed.
@@ -196,6 +198,15 @@ const NSString *FiSHKeyExchangeInfoRemoveOldTempKeyPairTimerKey = @&quot;FiSHKeyExcha
    [temporaryKeyExchangeInfosLock_ unlock];
 }
 
+- (void)handleKeyExchangeTimeoutForNickname:(NSString *)nickname onConnection:(id)connection;
+{
+   [self removeTemporaryKeyExchangeInfosForNickName:nickname onConnection:connection];
+   
+   [delegate_ outputStatusInformation:NSLocalizedString(@&quot;Timed out waiting for key-exchange reply.&quot;, &quot;Timed out waiting for key-exchange reply&quot;)
+                           forContext:nickname
+                                   on:connection];
+}
+
 - (void)handleFiSHKeyExchangeRequestFrom:(NSString *)nickname on:(id)connection withRemotePublicKeyData:(NSString *)remotePublicKeyData;
 {
    [delegate_ outputStatusInformation:NSLocalizedString(@&quot;Received key exchange request.&quot;, &quot;Received key exchange request&quot;)</diff>
      <filename>FiSHKeyExchanger.mm</filename>
    </modified>
    <modified>
      <diff>@@ -142,7 +142,7 @@ FiSHSecretStore *sharedSecretStore = nil;
    if (status != noErr)
    {
       // Something went wrong looking for/chaning/adding an entry in Keychain, just bail out.
-      NSLog(@&quot;Can't access Keychain.&quot;);
+      DLog(@&quot;Can't access Keychain.&quot;);
    }
    
    return (status == noErr);</diff>
      <filename>FiSHSecretStore.m</filename>
    </modified>
    <modified>
      <diff>@@ -23,6 +23,7 @@
 		D4A6B3840B8FB881001816EB /* FiSHEncryptionPrefs.m in Sources */ = {isa = PBXBuildFile; fileRef = D4A6B3830B8FB881001816EB /* FiSHEncryptionPrefs.m */; };
 		D4AFBC4A0B8A2F070086B38A /* NSData+FiSHyExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = D4AFBC490B8A2F070086B38A /* NSData+FiSHyExtensions.m */; };
 		D4BD4B080B8CD64A0016D3B9 /* LICENSE.txt in Resources */ = {isa = PBXBuildFile; fileRef = D4BD4B070B8CD64A0016D3B9 /* LICENSE.txt */; };
+		D4EF67C10B91CC900018A60E /* DLog.m in Sources */ = {isa = PBXBuildFile; fileRef = D4EF67C00B91CC900018A60E /* DLog.m */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
@@ -108,6 +109,8 @@
 		D4D8D8980B824922000FA9F8 /* dh1080.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = dh1080.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
 		D4E281520B8D06330095A792 /* buildDMG.pl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = buildDMG.pl; sourceTree = &quot;&lt;group&gt;&quot;; };
 		D4E2816C0B8D0E0F0095A792 /* READ ME.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = &quot;READ ME.rtf&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
+		D4EF67BF0B91CC900018A60E /* DLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DLog.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+		D4EF67C00B91CC900018A60E /* DLog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DLog.m; sourceTree = &quot;&lt;group&gt;&quot;; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -213,8 +216,10 @@
 		32C88E010371C26100C91783 /* Other Sources */ = {
 			isa = PBXGroup;
 			children = (
-				D4D8D8850B8248C0000FA9F8 /* Dirt */,
 				32DBCF630370AF2F00C91783 /* FiSHy_Prefix.pch */,
+				D4EF67BF0B91CC900018A60E /* DLog.h */,
+				D4EF67C00B91CC900018A60E /* DLog.m */,
+				D4D8D8850B8248C0000FA9F8 /* Dirt */,
 			);
 			name = &quot;Other Sources&quot;;
 			sourceTree = &quot;&lt;group&gt;&quot;;
@@ -437,6 +442,7 @@
 				D4423EA00B84BDFA0039DCB9 /* misc.cpp in Sources */,
 				D4AFBC4A0B8A2F070086B38A /* NSData+FiSHyExtensions.m in Sources */,
 				D4A6B3840B8FB881001816EB /* FiSHEncryptionPrefs.m in Sources */,
+				D4EF67C10B91CC900018A60E /* DLog.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -522,6 +528,7 @@
 					&quot;$(inherited)&quot;,
 					&quot;${COLLOQUY_SOURCE_FOLDER}/**&quot;,
 				);
+				OTHER_CFLAGS = &quot;-DDEBUG&quot;;
 				PREBINDING = NO;
 				SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
 				SYMROOT = &quot;${COLLOQUY_SOURCE_FOLDER}/build&quot;;
@@ -576,7 +583,7 @@
 		D496F46F0B80D2D00015B1F2 /* Development (Universal) */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				APPLICATION_VERSION = 0.3.0a1;
+				APPLICATION_VERSION = 0.3.0b1;
 				COLLOQUY_SOURCE_FOLDER = ../colloquy;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
@@ -584,6 +591,7 @@
 					&quot;$(inherited)&quot;,
 					&quot;${COLLOQUY_SOURCE_FOLDER}/**&quot;,
 				);
+				OTHER_CFLAGS = &quot;-DDEBUG&quot;;
 				PREBINDING = NO;
 				SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
 				SYMROOT = &quot;${COLLOQUY_SOURCE_FOLDER}/build&quot;;</diff>
      <filename>FiSHy.xcodeproj/project.pbxproj</filename>
    </modified>
    <modified>
      <diff>@@ -20,6 +20,7 @@
 
 #ifdef __OBJC__
     #import &lt;Cocoa/Cocoa.h&gt;
+    #import &quot;DLog.h&quot;
 #endif
 
 #ifndef MAC_OS_X_VERSION_10_5</diff>
      <filename>FiSHy_Prefix.pch</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>1c53128630e51c87dedf31211863210e27b72d05</id>
    </parent>
  </parents>
  <author>
    <name>henningkiel</name>
    <email>henningkiel</email>
  </author>
  <url>http://github.com/hennk/fishy/commit/a2fea2de0f285de5c3eb975ad4d4c6537764b455</url>
  <id>a2fea2de0f285de5c3eb975ad4d4c6537764b455</id>
  <committed-date>2007-02-25T09:01:05-08:00</committed-date>
  <authored-date>2007-02-25T09:01:05-08:00</authored-date>
  <message>Fixed a crash when a second /keyx was sent to a nick for which another /keyx was already pending. We now delete any prior keyx-infos before starting a new one.
Now prints a message when a /keyx timed out.
Uses DLog instead of NSLog. Logging to Console is disabled per default. To enable it, set the environment variable DEBUG to YES, or compile the sources with -DDEBUG.
Updated to use new Colloquy features introduced with the second version of the patch for ticket 1015.</message>
  <tree>60cd15c6974b5ce48d06c4a2c09224160be7e746</tree>
  <committer>
    <name>henningkiel</name>
    <email>henningkiel</email>
  </committer>
</commit>
