projects
/
citadel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
As per RFC3920 section 7, if an XMPP client does not specify a resource ID, generate...
[citadel.git]
/
citadel
/
modules
/
xmpp
/
serv_xmpp.c
diff --git
a/citadel/modules/xmpp/serv_xmpp.c
b/citadel/modules/xmpp/serv_xmpp.c
index 20f2089e33aab30f55098115fb890e41874b2c5a..cc75f6dd190751d88f112fa6c91035277d28c2d2 100644
(file)
--- a/
citadel/modules/xmpp/serv_xmpp.c
+++ b/
citadel/modules/xmpp/serv_xmpp.c
@@
-403,9
+403,14
@@
void xmpp_xml_end(void *data, const char *supplied_el) {
else if (
(XMPP->bind_requested)
&& (!IsEmptyStr(XMPP->iq_id))
else if (
(XMPP->bind_requested)
&& (!IsEmptyStr(XMPP->iq_id))
- && (!IsEmptyStr(XMPP->iq_client_resource))
&& (CC->logged_in)
&& (CC->logged_in)
- ) {
+ ) {
+
+ /* If the client has not specified a client resource, generate one */
+
+ if (IsEmptyStr(XMPP->iq_client_resource)) {
+ generate_uuid(XMPP->iq_client_resource);
+ }
/* Generate the "full JID" of the client resource */
/* Generate the "full JID" of the client resource */
@@
-415,6
+420,10
@@
void xmpp_xml_end(void *data, const char *supplied_el) {
XMPP->iq_client_resource
);
XMPP->iq_client_resource
);
+ /* FIXME look here ... there's nothing before the slash ... wtf?
+ syslog(LOG_DEBUG, "\033[31m client resource = '%s' \033[0m", XMPP->client_jid);
+ */
+
/* Tell the client what its JID is */
cprintf("<iq type=\"result\" id=\"%s\">", xmlesc(xmlbuf, XMPP->iq_id, sizeof xmlbuf));
/* Tell the client what its JID is */
cprintf("<iq type=\"result\" id=\"%s\">", xmlesc(xmlbuf, XMPP->iq_id, sizeof xmlbuf));