summaryrefslogtreecommitdiff
path: root/src/rexmpp.c
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2021-09-04 13:13:09 +0300
committerdefanor <defanor@uberspace.net>2021-09-04 13:13:09 +0300
commitf5942754fc0658d364ce4c38f0ecb91c91c2912a (patch)
tree91f25e06be66ebfeaae39dbbeb225fce81ec275d /src/rexmpp.c
parent0d5408caf8f1586b37b273ed4b1f38b24c411846 (diff)
Print names and shorter timestamps in xmpp.el
The conversation buffers now follow the <https://docs.modernxmpp.org/client/design/#names> recommendations for names, and the rexmpp_get_name function is adjusted to match those more closely.
Diffstat (limited to 'src/rexmpp.c')
-rw-r--r--src/rexmpp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rexmpp.c b/src/rexmpp.c
index d8a67c8..70ed886 100644
--- a/src/rexmpp.c
+++ b/src/rexmpp.c
@@ -250,6 +250,7 @@ xmlNodePtr rexmpp_find_event (rexmpp_t *s,
return NULL;
}
+/* https://docs.modernxmpp.org/client/design/#names */
char *rexmpp_get_name (rexmpp_t *s, const char *jid_str) {
struct rexmpp_jid jid;
if (rexmpp_jid_parse(jid_str, &jid) != 0) {
@@ -291,6 +292,9 @@ char *rexmpp_get_name (rexmpp_t *s, const char *jid_str) {
}
}
}
+ if (jid.local[0] != '\0') {
+ return strdup(jid.local);
+ }
return strdup(jid.bare);
}