ObjXMPP  Diff

Differences From Artifact [3047c2358f]:

To Artifact [42591349b1]:


1
2

3
4
5
6
7
8
9
/*
 * Copyright (c) 2011, Florian Zeitz <florob@babelmonkeys.de>

 *
 * https://heap.zone/objxmpp/
 *
 * 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.
 *


>







1
2
3
4
5
6
7
8
9
10
/*
 * Copyright (c) 2011, Florian Zeitz <florob@babelmonkeys.de>
 * Copyright (c) 2021, Jonathan Schleifer <js@nil.im>
 *
 * https://heap.zone/objxmpp/
 *
 * 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.
 *
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

OF_ASSUME_NONNULL_BEGIN

@class XMPPConnection;
@class XMPPIQ;

#ifdef OF_HAVE_BLOCKS
typedef void (^xmpp_callback_block_t)(XMPPConnection *_Nonnull,
    XMPPIQ *_Nonnull);
#endif

@interface XMPPCallback: OFObject
{
	id _target;
	SEL _selector;
#ifdef OF_HAVE_BLOCKS
	xmpp_callback_block_t _block;
#endif
}

#ifdef OF_HAVE_BLOCKS
+ (instancetype)callbackWithBlock: (xmpp_callback_block_t)callback;
- (instancetype)initWithBlock: (xmpp_callback_block_t)callback;
#endif

+ (instancetype)callbackWithTarget: (id)target
			  selector: (SEL)selector;
- (instancetype)initWithTarget: (id)target
		      selector: (SEL)selector;

- (void)runWithIQ: (XMPPIQ *)iq
       connection: (XMPPConnection *)connection;
@end

OF_ASSUME_NONNULL_END







|
<







|




|
|


|
<
|
<

|
<



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

OF_ASSUME_NONNULL_BEGIN

@class XMPPConnection;
@class XMPPIQ;

#ifdef OF_HAVE_BLOCKS
typedef void (^XMPPCallbackBlock)(XMPPConnection *_Nonnull, XMPPIQ *_Nonnull);

#endif

@interface XMPPCallback: OFObject
{
	id _target;
	SEL _selector;
#ifdef OF_HAVE_BLOCKS
	XMPPCallbackBlock _block;
#endif
}

#ifdef OF_HAVE_BLOCKS
+ (instancetype)callbackWithBlock: (XMPPCallbackBlock)callback;
- (instancetype)initWithBlock: (XMPPCallbackBlock)callback;
#endif

+ (instancetype)callbackWithTarget: (id)target selector: (SEL)selector;

- (instancetype)initWithTarget: (id)target selector: (SEL)selector;


- (void)runWithIQ: (XMPPIQ *)iq connection: (XMPPConnection *)connection;

@end

OF_ASSUME_NONNULL_END