ObjXMPP  Check-in [b31637cfd1]

Overview
Comment:Avoid string duplication
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: b31637cfd1da7d0b147b508f5777603fb3ed2b96bc2671604055b96e91f7a2cf
User & Date: js on 2021-04-29 00:14:09
Other Links: manifest | tags
Context
2021-04-29
00:15
heap.zone -> nil.im Leaf check-in: ae703bd9ba user: js tags: trunk
00:14
Avoid string duplication check-in: b31637cfd1 user: js tags: trunk
00:06
Adjust to ObjFW style check-in: 9919057cb8 user: js tags: trunk
Changes

Modified src/Makefile from [6e0c6cc9a7] to [c0f3f600bb].

25
26
27
28
29
30
31
32

33
34
35
36
37
38
39
40
41
42
       XMPPPLAINAuth.m		\
       XMPPPresence.m		\
       XMPPRoster.m		\
       XMPPRosterItem.m		\
       XMPPSCRAMAuth.m		\
       XMPPStanza.m		\
       XMPPStreamManagement.m	\
       XMPPXMLElementBuilder.m


INCLUDES = ${SRCS:.m=.h}	\
	   namespaces.h		\
	   ObjXMPP.h		\
	   XMPPStorage.h

include ../buildsys.mk

CPPFLAGS += -I..
LD = ${OBJC}







|
>


<







25
26
27
28
29
30
31
32
33
34
35

36
37
38
39
40
41
42
       XMPPPLAINAuth.m		\
       XMPPPresence.m		\
       XMPPRoster.m		\
       XMPPRosterItem.m		\
       XMPPSCRAMAuth.m		\
       XMPPStanza.m		\
       XMPPStreamManagement.m	\
       XMPPXMLElementBuilder.m	\
       namespaces.m

INCLUDES = ${SRCS:.m=.h}	\

	   ObjXMPP.h		\
	   XMPPStorage.h

include ../buildsys.mk

CPPFLAGS += -I..
LD = ${OBJC}

Modified src/XMPPConnection.m from [2a81d5959c] to [22f9cc7421].

634
635
636
637
638
639
640
641
642
643




644
645
646
647
648
649
650

	if (_language != nil)
		langString = [OFString stringWithFormat: @"xml:lang='%@' ",
							 _language];

	[_socket writeFormat: @"<?xml version='1.0'?>\n"
			      @"<stream:stream to='%@' "
			      @"xmlns='" XMPPClientNS @"' "
			      @"xmlns:stream='" XMPPStreamNS @"' %@"
			      @"version='1.0'>", _domain, langString];





	_streamOpen = true;
}

- (void)close
{
	if (_streamOpen)







|
|
|
>
>
>
>







634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654

	if (_language != nil)
		langString = [OFString stringWithFormat: @"xml:lang='%@' ",
							 _language];

	[_socket writeFormat: @"<?xml version='1.0'?>\n"
			      @"<stream:stream to='%@' "
			      @"xmlns='%@' "
			      @"xmlns:stream='%@' %@"
			      @"version='1.0'>",
			      _domain, 
			      XMPPClientNS,
			      XMPPStreamNS,
			      langString];

	_streamOpen = true;
}

- (void)close
{
	if (_streamOpen)

Modified src/namespaces.h from [8bdb649238] to [0ef1c0b1b3].

16
17
18
19
20
21
22

23

24
25
26
27
28
29
30
31
32
33
34
35
36
37
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */


#define XMPPBindNS @"urn:ietf:params:xml:ns:xmpp-bind"

#define XMPPCapsNS @"http://jabber.org/protocol/caps"
#define XMPPClientNS @"jabber:client"
#define XMPPDiscoInfoNS @"http://jabber.org/protocol/disco#info"
#define XMPPDiscoItemsNS @"http://jabber.org/protocol/disco#items"
#define XMPPMUCNS @"http://jabber.org/protocol/muc"
#define XMPPRosterNS @"jabber:iq:roster"
#define XMPPRosterVerNS @"urn:xmpp:features:rosterver"
#define XMPPSASLNS @"urn:ietf:params:xml:ns:xmpp-sasl"
#define XMPPSessionNS @"urn:ietf:params:xml:ns:xmpp-session"
#define XMPPSMNS @"urn:xmpp:sm:3"
#define XMPPStanzasNS @"urn:ietf:params:xml:ns:xmpp-stanzas"
#define XMPPStartTLSNS @"urn:ietf:params:xml:ns:xmpp-tls"
#define XMPPStreamNS @"http://etherx.jabber.org/streams"
#define XMPPXMPPStreamNS @"urn:ietf:params:xml:ns:xmpp-streams"







>
|
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import <ObjFW/ObjFW.h>

extern OFString *const XMPPBindNS;
extern OFString *const XMPPCapsNS;
extern OFString *const XMPPClientNS;
extern OFString *const XMPPDiscoInfoNS;
extern OFString *const XMPPDiscoItemsNS;
extern OFString *const XMPPMUCNS;
extern OFString *const XMPPRosterNS;
extern OFString *const XMPPRosterVerNS;
extern OFString *const XMPPSASLNS;
extern OFString *const XMPPSessionNS;
extern OFString *const XMPPSMNS;
extern OFString *const XMPPStanzasNS;
extern OFString *const XMPPStartTLSNS;
extern OFString *const XMPPStreamNS;
extern OFString *const XMPPXMPPStreamNS;

Added src/namespaces.m version [cfd4eec702].