Coding style.
This commit is contained in:
parent
fac12cfde9
commit
ed5604447a
10 changed files with 60 additions and 60 deletions
|
@ -55,13 +55,13 @@
|
|||
selector: selector] autorelease];
|
||||
}
|
||||
|
||||
- initWithTarget: (id)target_
|
||||
selector: (SEL)selector_
|
||||
- initWithTarget: (id)target
|
||||
selector: (SEL)selector
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
_target = [target_ retain];
|
||||
_selector = selector_;
|
||||
_target = [target retain];
|
||||
_selector = selector;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
|
|
@ -60,8 +60,8 @@
|
|||
|
||||
@interface XMPPConnection_ConnectThread: OFThread
|
||||
{
|
||||
OFThread *sourceThread;
|
||||
XMPPConnection *connection;
|
||||
OFThread *_sourceThread;
|
||||
XMPPConnection *_connection;
|
||||
}
|
||||
|
||||
- initWithSourceThread: (OFThread*)sourceThread
|
||||
|
@ -69,14 +69,14 @@
|
|||
@end
|
||||
|
||||
@implementation XMPPConnection_ConnectThread
|
||||
- initWithSourceThread: (OFThread*)sourceThread_
|
||||
connection: (XMPPConnection*)connection_
|
||||
- initWithSourceThread: (OFThread*)sourceThread
|
||||
connection: (XMPPConnection*)connection
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
@try {
|
||||
sourceThread = [sourceThread_ retain];
|
||||
connection = [connection_ retain];
|
||||
_sourceThread = [sourceThread retain];
|
||||
_connection = [connection retain];
|
||||
} @catch (id e) {
|
||||
[self release];
|
||||
@throw e;
|
||||
|
@ -87,8 +87,8 @@
|
|||
|
||||
- (void)dealloc
|
||||
{
|
||||
[sourceThread release];
|
||||
[connection release];
|
||||
[_sourceThread release];
|
||||
[_connection release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
@ -97,17 +97,17 @@
|
|||
{
|
||||
[self join];
|
||||
|
||||
[connection handleConnection];
|
||||
[_connection handleConnection];
|
||||
}
|
||||
|
||||
- (id)main
|
||||
{
|
||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
||||
|
||||
[connection connect];
|
||||
[_connection connect];
|
||||
|
||||
[self performSelector: @selector(didConnect)
|
||||
onThread: sourceThread
|
||||
onThread: _sourceThread
|
||||
waitUntilDone: false];
|
||||
|
||||
[pool release];
|
||||
|
@ -237,21 +237,21 @@
|
|||
return [[_server copy] autorelease];
|
||||
}
|
||||
|
||||
- (void)setDomain: (OFString*)domain_
|
||||
- (void)setDomain: (OFString*)domain
|
||||
{
|
||||
OFString *oldDomain = _domain;
|
||||
OFString *oldDomainToASCII = _domainToASCII;
|
||||
|
||||
if (domain_ != nil) {
|
||||
if (domain != nil) {
|
||||
char *srv;
|
||||
Stringprep_rc rc;
|
||||
|
||||
if ((rc = stringprep_profile([domain_ UTF8String], &srv,
|
||||
if ((rc = stringprep_profile([domain UTF8String], &srv,
|
||||
"Nameprep", 0)) != STRINGPREP_OK)
|
||||
@throw [XMPPStringPrepFailedException
|
||||
exceptionWithConnection: self
|
||||
profile: @"Nameprep"
|
||||
string: domain_];
|
||||
string: domain];
|
||||
|
||||
@try {
|
||||
_domain = [[OFString alloc] initWithUTF8String: srv];
|
||||
|
@ -1201,18 +1201,18 @@
|
|||
withObject: _JID];
|
||||
}
|
||||
|
||||
- (OFString*)XMPP_IDNAToASCII: (OFString*)domain_
|
||||
- (OFString*)XMPP_IDNAToASCII: (OFString*)domain
|
||||
{
|
||||
OFString *ret;
|
||||
char *cDomain;
|
||||
Idna_rc rc;
|
||||
|
||||
if ((rc = idna_to_ascii_8z([domain_ UTF8String],
|
||||
if ((rc = idna_to_ascii_8z([domain UTF8String],
|
||||
&cDomain, IDNA_USE_STD3_ASCII_RULES)) != IDNA_SUCCESS)
|
||||
@throw [XMPPIDNATranslationFailedException
|
||||
exceptionWithConnection: self
|
||||
operation: @"ToASCII"
|
||||
string: domain_];
|
||||
string: domain];
|
||||
|
||||
@try {
|
||||
ret = [[OFString alloc] initWithUTF8String: cDomain];
|
||||
|
|
|
@ -28,15 +28,15 @@
|
|||
#import "XMPPRosterItem.h"
|
||||
|
||||
@implementation XMPPContactManager
|
||||
- initWithConnection: (XMPPConnection*)connection_
|
||||
roster: (XMPPRoster*)roster_
|
||||
- initWithConnection: (XMPPConnection*)connection
|
||||
roster: (XMPPRoster*)roster
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
@try {
|
||||
_connection = connection_;
|
||||
_connection = connection;
|
||||
[_connection addDelegate: self];
|
||||
_roster = roster_;
|
||||
_roster = roster;
|
||||
[_roster addDelegate: self];
|
||||
_contacts = [[OFMutableDictionary alloc] init];
|
||||
_delegates = [[XMPPMulticastDelegate alloc] init];
|
||||
|
@ -89,7 +89,7 @@
|
|||
OF_GETTER(_contacts, true)
|
||||
}
|
||||
|
||||
- (void)rosterWasReceived: (XMPPRoster*)roster_
|
||||
- (void)rosterWasReceived: (XMPPRoster*)roster
|
||||
{
|
||||
OFEnumerator *contactEnumerator;
|
||||
XMPPContact *contact;
|
||||
|
@ -107,10 +107,10 @@
|
|||
[_contacts release];
|
||||
|
||||
_contacts = [[OFMutableDictionary alloc] init];
|
||||
rosterItems = [roster_ rosterItems];
|
||||
rosterItems = [roster rosterItems];
|
||||
rosterItemEnumerator = [rosterItems keyEnumerator];
|
||||
while ((bareJID = [rosterItemEnumerator nextObject]) != nil) {
|
||||
contact = [[XMPPContact new] autorelease];
|
||||
contact = [[[XMPPContact alloc] init] autorelease];
|
||||
[contact XMPP_setRosterItem:
|
||||
[rosterItems objectForKey: bareJID]];
|
||||
[_contacts setObject: contact
|
||||
|
@ -141,7 +141,7 @@
|
|||
}
|
||||
|
||||
if (contact == nil) {
|
||||
contact = [[XMPPContact new] autorelease];
|
||||
contact = [[[XMPPContact alloc] init] autorelease];
|
||||
[contact XMPP_setRosterItem: rosterItem];
|
||||
[_contacts setObject: contact
|
||||
forKey: bareJID];
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
node: nil];
|
||||
|
||||
@try {
|
||||
_discoNodes = [OFMutableDictionary new];
|
||||
_discoNodes = [[OFMutableDictionary alloc] init];
|
||||
_connection = connection;
|
||||
_capsNode = [capsNode copy];
|
||||
|
||||
|
|
|
@ -61,16 +61,16 @@
|
|||
self = [super init];
|
||||
|
||||
@try {
|
||||
if ((JID == nil) &&
|
||||
if (JID == nil &&
|
||||
![self isKindOfClass: [XMPPDiscoEntity class]])
|
||||
@throw [OFInvalidArgumentException exception];
|
||||
|
||||
_JID = [JID copy];
|
||||
_node = [node copy];
|
||||
_name = [name copy];
|
||||
_identities = [OFSortedList new];
|
||||
_features = [OFSortedList new];
|
||||
_childNodes = [OFMutableDictionary new];
|
||||
_identities = [[OFSortedList alloc] init];
|
||||
_features = [[OFSortedList alloc] init];
|
||||
_childNodes = [[OFMutableDictionary alloc] init];
|
||||
|
||||
[self addFeature: XMPP_NS_DISCO_ITEMS];
|
||||
[self addFeature: XMPP_NS_DISCO_INFO];
|
||||
|
|
|
@ -55,14 +55,14 @@
|
|||
self = [super init];
|
||||
|
||||
@try {
|
||||
OFAutoreleasePool *pool = [OFAutoreleasePool new];
|
||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
||||
|
||||
_file = [file copy];
|
||||
@try {
|
||||
_data = [[[OFDataArray dataArrayWithContentsOfFile:
|
||||
file] messagePackValue] retain];
|
||||
} @catch (id e) {
|
||||
_data = [OFMutableDictionary new];
|
||||
_data = [[OFMutableDictionary alloc] init];
|
||||
}
|
||||
|
||||
[pool release];
|
||||
|
@ -134,7 +134,7 @@
|
|||
- (void)setStringValue: (OFString*)string
|
||||
forPath: (OFString*)path
|
||||
{
|
||||
OFAutoreleasePool *pool = [OFAutoreleasePool new];
|
||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
||||
|
||||
[self XMPP_setObject: string
|
||||
forPath: path];
|
||||
|
@ -144,7 +144,7 @@
|
|||
|
||||
- (OFString*)stringValueForPath: (OFString*)path
|
||||
{
|
||||
OFAutoreleasePool *pool = [OFAutoreleasePool new];
|
||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
||||
OFString *string;
|
||||
|
||||
string = [self XMPP_objectForPath: path];
|
||||
|
@ -157,7 +157,7 @@
|
|||
- (void)setBooleanValue: (bool)boolean
|
||||
forPath: (OFString*)path
|
||||
{
|
||||
OFAutoreleasePool *pool = [OFAutoreleasePool new];
|
||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
||||
|
||||
[self XMPP_setObject: [OFNumber numberWithBool: boolean]
|
||||
forPath: path];
|
||||
|
@ -167,7 +167,7 @@
|
|||
|
||||
- (bool)booleanValueForPath: (OFString*)path
|
||||
{
|
||||
OFAutoreleasePool *pool = [OFAutoreleasePool new];
|
||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
||||
bool boolean;
|
||||
|
||||
boolean = [[self XMPP_objectForPath: path] boolValue];
|
||||
|
@ -180,7 +180,7 @@
|
|||
- (void)setIntegerValue: (intmax_t)integer
|
||||
forPath: (OFString*)path
|
||||
{
|
||||
OFAutoreleasePool *pool = [OFAutoreleasePool new];
|
||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
||||
|
||||
[self XMPP_setObject: [OFNumber numberWithIntMax: integer]
|
||||
forPath: path];
|
||||
|
@ -190,7 +190,7 @@
|
|||
|
||||
- (intmax_t)integerValueForPath: (OFString*)path
|
||||
{
|
||||
OFAutoreleasePool *pool = [OFAutoreleasePool new];
|
||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
||||
intmax_t integer;
|
||||
|
||||
integer = [[self XMPP_objectForPath: path] intMaxValue];
|
||||
|
@ -203,7 +203,7 @@
|
|||
- (void)setArray: (OFArray*)array
|
||||
forPath: (OFString*)path
|
||||
{
|
||||
OFAutoreleasePool *pool = [OFAutoreleasePool new];
|
||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
||||
|
||||
[self XMPP_setObject: array
|
||||
forPath: path];
|
||||
|
@ -213,7 +213,7 @@
|
|||
|
||||
- (OFArray*)arrayForPath: (OFString*)path
|
||||
{
|
||||
OFAutoreleasePool *pool = [OFAutoreleasePool new];
|
||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
||||
OFArray *array;
|
||||
|
||||
array = [self XMPP_objectForPath: path];
|
||||
|
@ -226,7 +226,7 @@
|
|||
- (void)setDictionary: (OFDictionary*)dictionary
|
||||
forPath: (OFString*)path
|
||||
{
|
||||
OFAutoreleasePool *pool = [OFAutoreleasePool new];
|
||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
||||
|
||||
[self XMPP_setObject: dictionary
|
||||
forPath: path];
|
||||
|
@ -236,7 +236,7 @@
|
|||
|
||||
- (OFDictionary*)dictionaryForPath: (OFString*)path
|
||||
{
|
||||
OFAutoreleasePool *pool = [OFAutoreleasePool new];
|
||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
||||
OFDictionary *dictionary;
|
||||
|
||||
dictionary = [self XMPP_objectForPath: path];
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
return ret;
|
||||
}
|
||||
|
||||
- (XMPPIQ*)errorIQWithType: (OFString*)type_
|
||||
- (XMPPIQ*)errorIQWithType: (OFString*)type
|
||||
condition: (OFString*)condition
|
||||
text: (OFString*)text
|
||||
{
|
||||
|
@ -75,7 +75,7 @@
|
|||
namespace: XMPP_NS_CLIENT];
|
||||
|
||||
[error addAttributeWithName: @"type"
|
||||
stringValue: type_];
|
||||
stringValue: type];
|
||||
[error addChild: [OFXMLElement elementWithName: condition
|
||||
namespace: XMPP_NS_STANZAS]];
|
||||
if (text)
|
||||
|
@ -91,10 +91,10 @@
|
|||
return ret;
|
||||
}
|
||||
|
||||
- (XMPPIQ*)errorIQWithType: (OFString*)type_
|
||||
- (XMPPIQ*)errorIQWithType: (OFString*)type
|
||||
condition: (OFString*)condition
|
||||
{
|
||||
return [self errorIQWithType: type_
|
||||
return [self errorIQWithType: type
|
||||
condition: condition
|
||||
text: nil];
|
||||
}
|
||||
|
|
|
@ -40,13 +40,13 @@
|
|||
#import "namespaces.h"
|
||||
|
||||
@implementation XMPPRoster
|
||||
- initWithConnection: (XMPPConnection*)connection_
|
||||
- initWithConnection: (XMPPConnection*)connection
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
@try {
|
||||
_rosterItems = [[OFMutableDictionary alloc] init];
|
||||
_connection = connection_;
|
||||
_connection = connection;
|
||||
[_connection addDelegate: self];
|
||||
_delegates = [[XMPPMulticastDelegate alloc] init];
|
||||
_dataStorage = [_connection dataStorage];
|
||||
|
@ -355,7 +355,7 @@
|
|||
![[element namespace] isEqual: XMPP_NS_ROSTER])
|
||||
continue;
|
||||
|
||||
pool = [OFAutoreleasePool new];
|
||||
pool = [[OFAutoreleasePool alloc] init];
|
||||
rosterItem = [self XMPP_rosterItemWithXMLElement: element];
|
||||
|
||||
[self XMPP_updateRosterItem: rosterItem];
|
||||
|
|
|
@ -114,8 +114,8 @@
|
|||
- (OFString*)XMPP_genNonce;
|
||||
- (uint8_t*)XMPP_HMACWithKey: (OFDataArray*)key
|
||||
data: (OFDataArray*)data;
|
||||
- (OFDataArray*)XMPP_hiWithData: (OFDataArray *)str
|
||||
salt: (OFDataArray *)salt_
|
||||
- (OFDataArray*)XMPP_hiWithData: (OFDataArray*)str
|
||||
salt: (OFDataArray*)salt
|
||||
iterationCount: (intmax_t)i;
|
||||
- (OFDataArray*)XMPP_parseServerFirstMessage: (OFDataArray*)data;
|
||||
- (OFDataArray*)XMPP_parseServerFinalMessage: (OFDataArray*)data;
|
||||
|
|
|
@ -474,8 +474,8 @@
|
|||
return [[hashO autorelease] digest];
|
||||
}
|
||||
|
||||
- (OFDataArray*)XMPP_hiWithData: (OFDataArray *)str
|
||||
salt: (OFDataArray *)salt_
|
||||
- (OFDataArray*)XMPP_hiWithData: (OFDataArray*)str
|
||||
salt: (OFDataArray*)salt
|
||||
iterationCount: (intmax_t)i
|
||||
{
|
||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
||||
|
@ -489,7 +489,7 @@
|
|||
@try {
|
||||
memset(result, 0, digestSize);
|
||||
|
||||
salty = [[salt_ copy] autorelease];
|
||||
salty = [[salt copy] autorelease];
|
||||
[salty addItems: "\0\0\0\1"
|
||||
count: 4];
|
||||
|
||||
|
@ -500,7 +500,7 @@
|
|||
result[j] ^= uOld[j];
|
||||
|
||||
for (j = 0; j < i - 1; j++) {
|
||||
tmp = [OFDataArray new];
|
||||
tmp = [[OFDataArray alloc] init];
|
||||
[tmp addItems: uOld
|
||||
count: digestSize];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue