XMPPMUCLight.h
2.85 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
//
// XMPPMUCLight.h
// Mangosta
//
// Created by Andres on 5/30/16.
// Copyright © 2016 Inaka. All rights reserved.
//
#import <XMPPFramework/XMPPFramework.h>
#import "XMPPFramework/XMPPJID.h"
/**
* The XMPPMUCLight module, combined with XMPPRoomLight and associated storage classes,
* provides an implementation of XEP-xxxx: Multi-User Chat Light a Proto XEP.
* More info: https://github.com/fenek/xeps/blob/muc_light/inbox/muc-light.xml
*
* The bulk of the code resides in XMPPRoomLight, which handles the xmpp technical details
* such as creating a room, leaving a room, adding users to a room, fetching the member list and
* sending messages
*
* The XMPPMUCLight class provides general (but important) tasks relating to MUCLight:
* - It discovers rooms for a service.
* - It monitors active XMPPRoomLight instances on the xmppStream.
* - It listens for MUCLigh room affiliation changes sent from other users.
* - It allows to block/unblock users/rooms
* - It lists the list of blocked users/rooms
*
* Server suport:
* - MongooseIM 2.0.0+ (https://github.com/esl/MongooseIM/)
*
* MUC Light: It's more suitable for mobile devices, where your connection might
* go up and down often, but you don't want that to affect the fact that you're "in"
* the room.
*
* Hightlights:
* - Lack of presences: there is no need to rejoin every room on reconnection.
* - Room version allows cheap checks whether room member list/configuration has
* changes. To be implemented in XMPPRoom
**/
@interface XMPPMUCLight : XMPPModule {
XMPPIDTracker *xmppIDTracker;
}
- (nonnull NSSet<XMPPJID*>*)rooms;
- (BOOL)discoverRoomsForServiceNamed:(nonnull NSString *)serviceName;
- (BOOL)requestBlockingList:(nonnull NSString *)serviceName;
- (BOOL)performActionOnElements:(nonnull NSArray<__kindof NSXMLElement *> *)elements forServiceNamed:(nonnull NSString *)serviceName;
@end
@protocol XMPPMUCLightDelegate
@optional
- (void)xmppMUCLight:(nonnull XMPPMUCLight *)sender didDiscoverRooms:(nonnull NSArray<__kindof NSXMLElement*>*)rooms forServiceNamed:(nonnull NSString *)serviceName;
- (void)xmppMUCLight:(nonnull XMPPMUCLight *)sender failedToDiscoverRoomsForServiceNamed:(nonnull NSString *)serviceName withError:(nonnull NSError *)error;
- (void)xmppMUCLight:(nonnull XMPPMUCLight *)sender changedAffiliation:(nonnull NSString *)affiliation roomJID:(nonnull XMPPJID *)roomJID;
- (void)xmppMUCLight:(nonnull XMPPMUCLight *)sender didRequestBlockingList:(nonnull NSArray<NSXMLElement*>*)items forServiceNamed:(nonnull NSString *)serviceName;
- (void)xmppMUCLight:(nonnull XMPPMUCLight *)sender failedToRequestBlockingList:(nonnull NSString *)serviceName withError:(nonnull XMPPIQ *)iq;
- (void)xmppMUCLight:(nonnull XMPPMUCLight *)sender didPerformAction:(nonnull XMPPIQ *)serviceName;
- (void)xmppMUCLight:(nonnull XMPPMUCLight *)sender failedToPerformAction:(nonnull XMPPIQ *)iq;
@end