Patch from Jortuny to allow specifying client version for QQ. Fixed a few things myself. Fixes #12748.
5 // Created by Evan Schoenberg on 8/7/06.
8 #import "ESPurpleQQAccount.h"
11 @implementation ESPurpleQQAccount
13 - (const char*)protocolPlugin
18 - (void)configurePurpleAccount
20 [super configurePurpleAccount];
22 purple_account_set_bool(account, "use_tcp", [[self preferenceForKey:KEY_QQ_USE_TCP group:GROUP_ACCOUNT_STATUS] boolValue]);
23 purple_account_set_string(account, "client_version", [[self preferenceForKey:KEY_QQ_CLIENT_VERSION group:GROUP_ACCOUNT_STATUS] UTF8String]);
27 * @brief The server name to be passed to libpurple
28 * QQ prpl will choose a server randomly for load balancing if we don't pass one, so do that. -self.host returns the first server
29 * for host reachability checking purpoes.
31 - (NSString *)hostForPurple
33 NSString *specifiedHost = [self preferenceForKey:KEY_CONNECT_HOST group:GROUP_ACCOUNT_STATUS];
34 return (specifiedHost ? specifiedHost : nil);
39 /* This is not technically right, since the qq plugin randomly chooses one of many different servers at connect time.
40 * "sz.tencent.com" or "sz#.tencent.com" for UDP
41 * "tcpconn.tencent.com" or "tcpconn#.tencent.com" where (# <= 6) for TCP.
42 * Specifying the host is important for network reachability checking, though, and generally all hosts should be up if one is reachable.
44 NSString *host = [self hostForPurple];
46 host = ([[self preferenceForKey:KEY_QQ_USE_TCP group:GROUP_ACCOUNT_STATUS] boolValue] ? @"tcpconn.tencent.com" : @"sz.tencent.com");
51 #pragma mark Account Action Menu Items
52 - (NSString *)titleForAccountActionMenuLabel:(const char *)label
54 if (label && (strcmp(label, _("Modify my information")) == 0)) {
55 return AILocalizedString(@"Modify My Information", "Menu title for configuring the public information for a QQ account");
58 return [super titleForAccountActionMenuLabel:label];