XMPPvCardCoreDataStorageObject.h
1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//
// XMPPvCardCoreDataStorageObject.h
// XEP-0054 vCard-temp
//
// Originally created by Eric Chamberlain on 3/18/11.
//
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
@class XMPPJID;
@class XMPPvCardTemp;
@class XMPPvCardTempCoreDataStorageObject;
@class XMPPvCardAvatarCoreDataStorageObject;
@interface XMPPvCardCoreDataStorageObject : NSManagedObject
/*
* User's JID, indexed for lookups
*/
@property (nonatomic, strong) NSString * jidStr;
/*
* User's photoHash used by XEP-0153
*/
@property (nonatomic, strong, readonly) NSString * photoHash;
/*
* The last time the record was modified, also used to determine if we need to fetch again
*/
@property (nonatomic, strong) NSDate * lastUpdated;
/*
* Flag indicating whether a get request is already pending, used in conjunction with lastUpdated
*/
@property (nonatomic, strong) NSNumber * waitingForFetch;
/*
* Relationship to the vCardTemp record.
* We use a relationship, so the vCardTemp stays faulted until we really need it.
*/
@property (nonatomic, strong) XMPPvCardTempCoreDataStorageObject * vCardTempRel;
/*
* Relationship to the vCardAvatar record.
* We use a relationship, so the vCardAvatar stays faulted until we really need it.
*/
@property (nonatomic, strong) XMPPvCardAvatarCoreDataStorageObject * vCardAvatarRel;
/*
* Accessor to retrieve photoData, so we can hide the underlying relationship implementation.
*/
@property (nonatomic, strong) NSData *photoData;
/*
* Accessor to retrieve vCardTemp, so we can hide the underlying relationship implementation.
*/
@property (nonatomic, strong) XMPPvCardTemp *vCardTemp;
+ (XMPPvCardCoreDataStorageObject *)fetchOrInsertvCardForJID:(XMPPJID *)jid
inManagedObjectContext:(NSManagedObjectContext *)moc;
@end