-
Notifications
You must be signed in to change notification settings - Fork 2
/
XMPPIdentity.h
97 lines (95 loc) · 2.63 KB
/
XMPPIdentity.h
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//
// XMPPIdentity.h
// Jabber
//
// Created by David Chisnall on 20/08/2004.
// Copyright 2004 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "JID.h"
#import <EtoileXML/ETXMLNullHandler.h>
#import "XMPPPresence.h"
#import "XMPPDispatcher.h"
/**
* A XMPPIdentity represents a unique endpoint in the Jabber network. Each
* person may have a collection of identities, corresponding to different client
* or different means of accessing them (e.g. a pure Jabber ID and a
* legacy-protocol gateway Jabber ID both of which are used from the same
* client.
*
* This abstraction allows conversations to be tied to people, rather than to
* clients. The roster will assume that entries in the same group with the same
* name correspond to the same person. Similarly, different resources of the
* same JID will be treated as different identities belonging to the same
* person.
*/
@interface XMPPIdentity : ETXMLNullHandler {
id person;
JID * jid;
NSString * subscription;
NSString * ask;
NSString * group;
NSString * name;
XMPPPresence * presence;
int priority;
int basePriority;
}
/**
* Create a new identity for the specified person. The name and group should
* match that of the person.
*/
- (id) initWithJID:(JID*)_jid withName:(NSString*)_name inGroup:(NSString*)_group forPerson:(id)_person;
/**
* Set the presence of the identity. Used whenever a presence stanza is
* received.
*/
- (void) setPresence:(XMPPPresence*)_presence;
/**
* Return the person with whom this identity is associated.
*/
- (id) person;
/**
* Set the person with whom this identity is associated.
*/
- (void) person:(id)_person;
/**
* Return the name of the identity.
*/
- (NSString*) name;
/**
* Return the roster group of the identity.
*/
- (NSString*) group;
- (void) setName:(NSString*)aName;
- (void) setGroup:(NSString*)aGroup;
/**
* Return the Jabber ID of the identity.
*/
- (JID*) jid;
/**
* Return the current presence of the identity.
*/
- (XMPPPresence*) presence;
/**
* Return the priority associated with the current presence of the identity.
*/
- (int) priority;
/**
* The type of subscription that the user has to this contact.
*/
- (NSString*) subscription;
/**
* Type of subscription being requested by this contact.
*/
- (NSString*) ask;
/**
* Compare two identities by their priority. Used to determine which should
* be the default recipient of messages.
*/
- (NSComparisonResult) compareByPriority:(XMPPIdentity*)_other;
/**
* Compare two identities by their JID. Commonly used to sort identities for
* display in a UI.
*/
- (NSComparisonResult) compareByJID:(XMPPIdentity*)_other;
@end