Ticket #1527: version-privacy.patch
| File version-privacy.patch, 2.8 KB (added by shadowofged, 3 years ago) |
|---|
-
Chat
2127 2127 2128 2128 if( request ) { 2129 2129 if( [command isCaseInsensitiveEqualToString:@"VERSION"] ) { 2130 NSDictionary *systemVersion = [[NSDictionary allocWithZone:nil] initWithContentsOfFile:@"/System/Library/CoreServices/ServerVersion.plist"]; 2131 if( ! [systemVersion count] ) systemVersion = [[NSDictionary allocWithZone:nil] initWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"]; 2130 NSUserDefaults * userDefaults = [NSUserDefaults standardUserDefaults]; 2131 BOOL hideSystemName = [userDefaults boolForKey:@"MVChatHideSystemName"]; 2132 BOOL hideSystemVersion = [userDefaults boolForKey:@"MVChatHideSystemVersion"]; 2133 BOOL hideSystemArch = [userDefaults boolForKey:@"MVChatHideSystemArch"]; 2134 2132 2135 NSDictionary *clientVersion = [[NSBundle mainBundle] infoDictionary]; 2133 2136 NSDictionary *systemVersion = nil; 2137 2138 systemVersion = [[NSDictionary allocWithZone:nil] initWithContentsOfFile:@"/System/Library/CoreServices/ServerVersion.plist"]; 2139 if ( ! [systemVersion count] ) 2140 { 2141 [systemVersion release]; 2142 systemVersion = [[NSDictionary allocWithZone:nil] initWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"]; 2143 } 2144 2134 2145 #if __ppc__ 2135 2146 NSString *processor = @"PowerPC"; 2136 2147 #elif __i386__ … … 2141 2152 NSString *processor = @"Unknown Architecture"; 2142 2153 #endif 2143 2154 2144 NSString *reply = [[NSString allocWithZone:nil] initWithFormat:@"%@ %@ (%@) - %@ %@ (%@) - %@", [clientVersion objectForKey:@"CFBundleName"], [clientVersion objectForKey:@"CFBundleShortVersionString"], [clientVersion objectForKey:@"CFBundleVersion"], [systemVersion objectForKey:@"ProductName"], [systemVersion objectForKey:@"ProductVersion"], processor, [clientVersion objectForKey:@"MVChatCoreCTCPVersionReplyInfo"]]; 2155 NSMutableString *reply = [[NSMutableString allocWithZone:nil] init]; 2156 [reply appendFormat:@"%@ %@ (%@)", 2157 [clientVersion objectForKey:@"CFBundleName"], 2158 [clientVersion objectForKey:@"CFBundleShortVersionString"], 2159 [clientVersion objectForKey:@"CFBundleVersion"]]; 2160 2161 if (!hideSystemName || !hideSystemVersion || !hideSystemArch) 2162 [reply appendString:@" -"]; 2163 2164 if (!hideSystemName) 2165 [reply appendFormat:@" %@", [systemVersion objectForKey:@"ProductName"]]; 2166 if (!hideSystemVersion) 2167 [reply appendFormat:@" %@", [systemVersion objectForKey:@"ProductVersion"]]; 2168 if (!hideSystemArch) 2169 [reply appendFormat:@" (%@)", processor]; 2170 2171 [reply appendFormat:@" - %@", [clientVersion objectForKey:@"MVChatCoreCTCPVersionReplyInfo"]]; 2172 2145 2173 [sender sendSubcodeReply:command withArguments:reply]; 2146 2174 2147 2175 [reply release];
