@@ -1,9 +1,10 @@ /* * Copyright (c) 2013, Florian Zeitz + * Copyright (c) 2013, 2016, Jonathan Schleifer * - * https://webkeks.org/git/?p=objxmpp.git + * https://heap.zone/git/?p=objxmpp.git * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice is present in all copies. * @@ -23,10 +24,13 @@ #import "XMPPContact.h" #import "XMPPMessage.h" #import "XMPPConnection.h" @implementation XMPPContact +@synthesize rosterItem = _rosterItem; +@synthesize presences = _presences; + - init { self = [super init]; @try { @@ -44,20 +48,10 @@ [_presences release]; [super dealloc]; } -- (XMPPRosterItem*)rosterItem -{ - OF_GETTER(_rosterItem, true) -} - -- (OFDictionary*)presences -{ - OF_GETTER(_presences, true) -} - - (void)sendMessage: (XMPPMessage*)message connection: (XMPPConnection*)connection { if (_lockedOnJID == nil) [message setTo: [_rosterItem JID]]; @@ -67,11 +61,13 @@ [connection sendStanza: message]; } - (void)XMPP_setRosterItem: (XMPPRosterItem*)rosterItem { - OF_SETTER(_rosterItem, rosterItem, true, 0); + XMPPRosterItem *old = _rosterItem; + _rosterItem = [rosterItem retain]; + [old release]; } - (void)XMPP_setPresence: (XMPPPresence*)presence resource: (OFString*)resource { @@ -97,8 +93,10 @@ [self XMPP_setLockedOnJID: nil]; } - (void)XMPP_setLockedOnJID: (XMPPJID*)JID; { - OF_SETTER(_lockedOnJID, JID, true, 0); + XMPPJID *old = _lockedOnJID; + _lockedOnJID = [JID retain]; + [old release]; } @end