projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
93f719e
)
The user principal identity is now used as the JID in all XMPP protocol stanzas.
author
Art Cancro
<ajc@citadel.org>
Mon, 25 Nov 2019 04:45:05 +0000
(23:45 -0500)
committer
Art Cancro
<ajc@citadel.org>
Mon, 25 Nov 2019 04:45:05 +0000
(23:45 -0500)
citadel/context.h
patch
|
blob
|
history
citadel/modules/instmsg/serv_instmsg.c
patch
|
blob
|
history
citadel/modules/xmpp/serv_xmpp.c
patch
|
blob
|
history
citadel/modules/xmpp/xmpp_messages.c
patch
|
blob
|
history
citadel/modules/xmpp/xmpp_presence.c
patch
|
blob
|
history
citadel/modules/xmpp/xmpp_query_namespace.c
patch
|
blob
|
history
citadel/user_ops.c
patch
|
blob
|
history
diff --git
a/citadel/context.h
b/citadel/context.h
index 95fa16d90d70be27216ffbf55105807f9e531a78..e76d7acb024a3cf7d676c34b126eb7ef9db42b7d 100644
(file)
--- a/
citadel/context.h
+++ b/
citadel/context.h
@@
-91,6
+91,7
@@
struct CitContext {
char cs_addr[64]; /* address logged in from */
/* The Internet type of thing */
char cs_addr[64]; /* address logged in from */
/* The Internet type of thing */
+ char cs_principal_id[256]; /* User principal identity for XMPP, ActivityPub, etc. */
char cs_inet_email[128]; /* Return address of outbound Internet mail */
char cs_inet_other_emails[1024]; /* User's other valid Internet email addresses */
char cs_inet_fn[128]; /* Friendly-name of outbound Internet mail */
char cs_inet_email[128]; /* Return address of outbound Internet mail */
char cs_inet_other_emails[1024]; /* User's other valid Internet email addresses */
char cs_inet_fn[128]; /* Friendly-name of outbound Internet mail */
diff --git
a/citadel/modules/instmsg/serv_instmsg.c
b/citadel/modules/instmsg/serv_instmsg.c
index dfa16cc689eb75ca34c3b51a2b2815b9cc433b40..fad00f0ef6c28492d5156b962f20492518477c13 100644
(file)
--- a/
citadel/modules/instmsg/serv_instmsg.c
+++ b/
citadel/modules/instmsg/serv_instmsg.c
@@
-294,7
+294,7
@@
void cmd_sexp(char *argbuf)
return;
}
return;
}
- lem = CC->cs_
inet_email
;
+ lem = CC->cs_
principal_id
;
extract_token(x_user, argbuf, 0, '|', sizeof x_user);
extract_token(x_msg, argbuf, 1, '|', sizeof x_msg);
extract_token(x_user, argbuf, 0, '|', sizeof x_user);
extract_token(x_msg, argbuf, 1, '|', sizeof x_msg);
diff --git
a/citadel/modules/xmpp/serv_xmpp.c
b/citadel/modules/xmpp/serv_xmpp.c
index c2d498ba4580d1c4aa0abdae979582e82c9aa325..84aa4ba38bbdafee127706d2b3beead9c8443102 100644
(file)
--- a/
citadel/modules/xmpp/serv_xmpp.c
+++ b/
citadel/modules/xmpp/serv_xmpp.c
@@
-420,7
+420,7
@@
void xmpp_xml_end(void *data, const char *supplied_el) {
}
/* Generate the "full JID" of the client (user@host/resource) */
}
/* Generate the "full JID" of the client (user@host/resource) */
- snprintf(XMPP->client_jid, sizeof XMPP->client_jid, "%s/%s", CC->cs_
inet_email
, XMPP->iq_client_resource);
+ snprintf(XMPP->client_jid, sizeof XMPP->client_jid, "%s/%s", CC->cs_
principal_id
, XMPP->iq_client_resource);
/* 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));
@@
-649,7
+649,7
@@
void xmpp_async_loop(void) {
* Login hook for XMPP sessions
*/
void xmpp_login_hook(void) {
* Login hook for XMPP sessions
*/
void xmpp_login_hook(void) {
- xmpp_queue_event(XMPP_EVT_LOGIN, CC->cs_
inet_email
);
+ xmpp_queue_event(XMPP_EVT_LOGIN, CC->cs_
principal_id
);
}
}
@@
-657,7
+657,7
@@
void xmpp_login_hook(void) {
* Logout hook for XMPP sessions
*/
void xmpp_logout_hook(void) {
* Logout hook for XMPP sessions
*/
void xmpp_logout_hook(void) {
- xmpp_queue_event(XMPP_EVT_LOGOUT, CC->cs_
inet_email
);
+ xmpp_queue_event(XMPP_EVT_LOGOUT, CC->cs_
principal_id
);
}
}
diff --git
a/citadel/modules/xmpp/xmpp_messages.c
b/citadel/modules/xmpp/xmpp_messages.c
index 90e09e281e0b7258ec78d4d320abd112e2b70093..3a114273ac94fee72a8398124d9ba9e01b5e6144 100644
(file)
--- a/
citadel/modules/xmpp/xmpp_messages.c
+++ b/
citadel/modules/xmpp/xmpp_messages.c
@@
-97,14
+97,14
@@
void xmpp_send_message(char *message_to, char *message_body) {
for (cptr = ContextList; cptr != NULL; cptr = cptr->next) {
if ( (cptr->logged_in)
&& (cptr->can_receive_im)
for (cptr = ContextList; cptr != NULL; cptr = cptr->next) {
if ( (cptr->logged_in)
&& (cptr->can_receive_im)
- && (!strcasecmp(cptr->cs_
inet_email
, message_to))
+ && (!strcasecmp(cptr->cs_
principal_id
, message_to))
) {
recp = cptr->user.fullname;
}
}
if (recp) {
) {
recp = cptr->user.fullname;
}
}
if (recp) {
- PerformXmsgHooks(CC->user.fullname, CC->cs_
inet_email
, recp, message_body);
+ PerformXmsgHooks(CC->user.fullname, CC->cs_
principal_id
, recp, message_body);
}
free(XMPP->message_body);
}
free(XMPP->message_body);
diff --git
a/citadel/modules/xmpp/xmpp_presence.c
b/citadel/modules/xmpp/xmpp_presence.c
index 4f71c7eea9ed4dfcaffcc9d4ac6b7b6fd82aba06..8fa6dea7fa6e7cddbf577828ff8db7ed0b47fbbb 100644
(file)
--- a/
citadel/modules/xmpp/xmpp_presence.c
+++ b/
citadel/modules/xmpp/xmpp_presence.c
@@
-106,7
+106,7
@@
void xmpp_wholist_presence_dump(void)
for (i=0; i<nContexts; i++) {
if (xmpp_is_visible(&cptr[i], CC)) {
for (i=0; i<nContexts; i++) {
if (xmpp_is_visible(&cptr[i], CC)) {
- xmpp_indicate_presence(cptr[i].cs_
inet_email
);
+ xmpp_indicate_presence(cptr[i].cs_
principal_id
);
}
}
free(cptr);
}
}
free(cptr);
@@
-149,7
+149,7
@@
void xmpp_destroy_buddy(char *presence_jid, int aggressively) {
/* Do an unsolicited roster update that deletes the contact. */
cprintf("<iq from=\"%s\" to=\"%s\" id=\"unbuddy_%x\" type=\"result\">",
/* Do an unsolicited roster update that deletes the contact. */
cprintf("<iq from=\"%s\" to=\"%s\" id=\"unbuddy_%x\" type=\"result\">",
- xmlesc(xmlbuf1, CC->cs_
inet_email
, sizeof xmlbuf1),
+ xmlesc(xmlbuf1, CC->cs_
principal_id
, sizeof xmlbuf1),
xmlesc(xmlbuf2, XMPP->client_jid, sizeof xmlbuf2),
++unsolicited_id
);
xmlesc(xmlbuf2, XMPP->client_jid, sizeof xmlbuf2),
++unsolicited_id
);
@@
-184,7
+184,7
@@
void xmpp_presence_notify(char *presence_jid, int event_type) {
/* Count the visible sessions for this user */
for (i=0; i<nContexts; i++) {
/* Count the visible sessions for this user */
for (i=0; i<nContexts; i++) {
- if ( (!strcasecmp(cptr[i].cs_
inet_email
, presence_jid))
+ if ( (!strcasecmp(cptr[i].cs_
principal_id
, presence_jid))
&& (xmpp_is_visible(&cptr[i], CC))
) {
++visible_sessions;
&& (xmpp_is_visible(&cptr[i], CC))
) {
++visible_sessions;
@@
-330,7
+330,7
@@
void xmpp_massacre_roster(void)
for (i=0; i<nContexts; i++) {
if (xmpp_is_visible(&cptr[i], CC)) {
if (mortuary) {
for (i=0; i<nContexts; i++) {
if (xmpp_is_visible(&cptr[i], CC)) {
if (mortuary) {
- char *buddy = strdup(cptr[i].cs_
inet_email
);
+ char *buddy = strdup(cptr[i].cs_
principal_id
);
Put(mortuary, buddy, strlen(buddy), buddy, NULL);
}
}
Put(mortuary, buddy, strlen(buddy), buddy, NULL);
}
}
@@
-376,7
+376,7
@@
void xmpp_delete_old_buddies_who_no_longer_exist_from_the_client_roster(void)
online_now = 0;
if (cptr) for (i=0; i<nContexts; i++) {
if (xmpp_is_visible(&cptr[i], CC)) {
online_now = 0;
if (cptr) for (i=0; i<nContexts; i++) {
if (xmpp_is_visible(&cptr[i], CC)) {
- if (!strcasecmp(cptr[i].cs_
inet_email
, (char *)Value)) {
+ if (!strcasecmp(cptr[i].cs_
principal_id
, (char *)Value)) {
online_now = 1;
}
}
online_now = 1;
}
}
diff --git
a/citadel/modules/xmpp/xmpp_query_namespace.c
b/citadel/modules/xmpp/xmpp_query_namespace.c
index f221cc28a9f16a36db3015481388a819055c70a3..1b17b952f166ec0c5a3f544f08e033552ac73177 100644
(file)
--- a/
citadel/modules/xmpp/xmpp_query_namespace.c
+++ b/
citadel/modules/xmpp/xmpp_query_namespace.c
@@
-57,7
+57,7
@@
void xmpp_roster_item(struct CitContext *cptr) {
char xmlbuf2[256];
cprintf("<item jid=\"%s\" name=\"%s\" subscription=\"both\">",
char xmlbuf2[256];
cprintf("<item jid=\"%s\" name=\"%s\" subscription=\"both\">",
- xmlesc(xmlbuf1, cptr->cs_
inet_email
, sizeof xmlbuf1),
+ xmlesc(xmlbuf1, cptr->cs_
principal_id
, sizeof xmlbuf1),
xmlesc(xmlbuf2, cptr->user.fullname, sizeof xmlbuf2)
);
cprintf("<group>%s</group>", xmlesc(xmlbuf1, CtdlGetConfigStr("c_humannode"), sizeof xmlbuf1));
xmlesc(xmlbuf2, cptr->user.fullname, sizeof xmlbuf2)
);
cprintf("<group>%s</group>", xmlesc(xmlbuf1, CtdlGetConfigStr("c_humannode"), sizeof xmlbuf1));
diff --git
a/citadel/user_ops.c
b/citadel/user_ops.c
index c215e734a6706940472766ac502b366385868c4d..0507fc6baca99c4132d008d1f7f32bf91414addb 100644
(file)
--- a/
citadel/user_ops.c
+++ b/
citadel/user_ops.c
@@
-697,6
+697,12
@@
void do_login(void)
AutoGenerateEmailAddressForUser(&CC->user);
}
AutoGenerateEmailAddressForUser(&CC->user);
}
+ /* Populate the user principal identity, which is consistent and never aliased */
+ strcpy(CC->cs_principal_id, "wowowowow");
+ makeuserkey(CC->cs_principal_id, CC->user.fullname, sizeof CC->user.fullname);
+ strcat(CC->cs_principal_id, "@");
+ strcat(CC->cs_principal_id, CtdlGetConfigStr("c_fqdn"));
+
/*
* Populate cs_inet_email and cs_inet_other_emails with valid email addresses from the user record
*/
/*
* Populate cs_inet_email and cs_inet_other_emails with valid email addresses from the user record
*/