Revision: 29694
          http://sourceforge.net/p/bibdesk/svn/29694
Author:   hofman
Date:     2025-10-10 15:47:42 +0000 (Fri, 10 Oct 2025)
Log Message:
-----------
rename protocol version class properties to clarify which protocol they refer to

Modified Paths:
--------------
    trunk/bibdesk/BDSKSharingBrowser.m
    trunk/bibdesk/BDSKSharingClient.m
    trunk/bibdesk/BDSKSharingServer.m

Modified: trunk/bibdesk/BDSKSharingBrowser.m
===================================================================
--- trunk/bibdesk/BDSKSharingBrowser.m  2025-10-10 15:41:52 UTC (rev 29693)
+++ trunk/bibdesk/BDSKSharingBrowser.m  2025-10-10 15:47:42 UTC (rev 29694)
@@ -60,7 +60,7 @@
 
 // This is the minimal version for the server that we require
 // If we introduce incompatible changes in future, bump this to avoid sharing 
breakage
-+ (NSString *)requiredProtocolVersion { return @"0"; }
++ (NSString *)requiredServerProtocolVersion { return @"0"; }
 
 + (BDSKSharingBrowser *)sharedBrowser{
     if(sharedBrowser == nil)
@@ -88,10 +88,10 @@
     NSData *TXTData = [aNetService TXTRecordData];
     NSString *version = nil;
     // check the version for compatibility; this is our own versioning system
-    // version is [BDSKSharingServer supportedProtocolVersion] of the server
+    // version is [BDSKSharingServer supportedServerProtocolVersion] of the 
server
     if(TXTData)
         version = [[NSString alloc] initWithData:[[NSNetService 
dictionaryFromTXTRecordData:TXTData] objectForKey:BDSKTXTVersionKey] 
encoding:NSUTF8StringEncoding];
-    return [version numericCompare:[BDSKSharingBrowser 
requiredProtocolVersion]] != NSOrderedAscending;
+    return [version numericCompare:[BDSKSharingBrowser 
requiredServerProtocolVersion]] != NSOrderedAscending;
 }
 
 - (void)netServiceDidResolveAddress:(NSNetService *)aNetService

Modified: trunk/bibdesk/BDSKSharingClient.m
===================================================================
--- trunk/bibdesk/BDSKSharingClient.m   2025-10-10 15:41:52 UTC (rev 29693)
+++ trunk/bibdesk/BDSKSharingClient.m   2025-10-10 15:47:42 UTC (rev 29694)
@@ -166,7 +166,7 @@
 
 // If we introduce incompatible changes in future, bump this to avoid sharing 
breakage
 // Note we should always support -invalidate, as this can be called when we're 
not accepted
-+ (NSString *)supportedProtocolVersion { return @"1"; }
++ (NSString *)supportedClientProtocolVersion { return @"1"; }
 
 - (instancetype)initWithClient:(BDSKSharingClient *)aClient 
andService:(NSNetService *)aService;
 {
@@ -435,7 +435,7 @@
                 uniqueIdentifier = [NSString uniqueString];
                 @try {
                     NSProtocolChecker *checker = [NSProtocolChecker 
protocolCheckerWithTarget:self protocol:@protocol(BDSKSharingClient)];
-                    [proxy registerClient:checker 
forIdentifier:uniqueIdentifier version:[BDSKAsyncSharingClient 
supportedProtocolVersion]];
+                    [proxy registerClient:checker 
forIdentifier:uniqueIdentifier version:[BDSKAsyncSharingClient 
supportedClientProtocolVersion]];
                     // mark as not yet authenticated
                     isNew = YES;
                 }

Modified: trunk/bibdesk/BDSKSharingServer.m
===================================================================
--- trunk/bibdesk/BDSKSharingServer.m   2025-10-10 15:41:52 UTC (rev 29693)
+++ trunk/bibdesk/BDSKSharingServer.m   2025-10-10 15:47:42 UTC (rev 29694)
@@ -222,7 +222,7 @@
 }
 
 // If we introduce incompatible changes in future, bump this to avoid sharing 
breakage
-+ (NSString *)supportedProtocolVersion { return @"1"; }
++ (NSString *)supportedServerProtocolVersion { return @"1"; }
 
 + (BDSKSharingServer *)sharedServer;
 {
@@ -325,7 +325,7 @@
     NSNetService *aNetService = [[NSNetService alloc] initWithDomain:@"" 
type:BDSKNetServiceDomain name:aSharingName port:port];
     [aNetService setDelegate:self];
     NSDictionary *dictionary = @{BDSKTXTVersionKey:
-        [BDSKSharingServer supportedProtocolVersion],
+        [BDSKSharingServer supportedServerProtocolVersion],
                                  BDSKTXTAuthenticateKey: [[NSUserDefaults 
standardUserDefaults] stringForKey:BDSKSharingRequiresPasswordKey]};
     [aNetService setTXTRecordData:[NSNetService 
dataFromTXTRecordDictionary:dictionary]];
     
@@ -588,7 +588,7 @@
 
 // This is the minimal version for the client that we require
 // If we introduce incompatible changes in future, bump this to avoid sharing 
breakage
-+ (NSString *)requiredProtocolVersion { return @"0"; }
++ (NSString *)requiredClientProtocolVersion { return @"0"; }
 
 - (instancetype)initForSharingServer:(BDSKSharingServer *)aSharingServer
 {
@@ -758,13 +758,13 @@
         if ([client connection] == clientConnection) break;
     
     // we don't register clients that have a version we don't support
-    // version is [BDSKSharingClientServer supportedProtocolVersion] from the 
client
+    // version is [BDSKSharingClientServer supportedClientProtocolVersion] 
from the client
     if(client == nil){
         // should never happen
         client = [[BDSKConnectedClient alloc] 
initWithConnection:clientConnection];
         [client setProxy:clientObject];
         [client invalidate];
-    }else if([version numericCompare:[BDSKAsyncSharingServer 
requiredProtocolVersion]] == NSOrderedAscending){
+    }else if([version numericCompare:[BDSKAsyncSharingServer 
requiredClientProtocolVersion]] == NSOrderedAscending){
         [[self class] cancelPreviousPerformRequestsWithTarget:self 
selector:@selector(removeUnregisteredClient:) object:client];
         [client invalidate];
         [connectedClients removeObject:client];

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to