jcs
/subtext
/amendments
/548
mail: Supress FTN point when zero in the message list as done elsewhere
jcs made amendment 548 about 1 year ago
--- mail.c Tue Nov 14 11:29:40 2023
+++ mail.c Thu Nov 16 13:08:22 2023
@@ -534,10 +534,12 @@ mail_list(struct session *s, size_t nmail_ids, unsigne
xfree(&data);
if (msg.ftn_from[0] && msg.recipient_user_id) {
- snprintf(from, sizeof(from), "%s@%u:%u/%u.%u",
+ size = snprintf(from, sizeof(from), "%s@%u:%u/%u",
msg.ftn_from, msg.ftn_msgid.zone,
- msg.ftn_msgid.net, msg.ftn_msgid.node,
- msg.ftn_msgid.point);
+ msg.ftn_msgid.net, msg.ftn_msgid.node);
+ if (msg.ftn_msgid.point != 0)
+ snprintf(from + size, sizeof(from) - size,
+ ".%u", msg.ftn_msgid.point);
} else {
user = user_username(msg.sender_user_id);
strlcpy(from, user ? user->username : "(unknown)",
@@ -615,7 +617,7 @@ mail_read(struct session *s, unsigned long id, short i
}
if (msg.ftn_to[0]) {
- snprintf(to, sizeof(to), "%s@%u:%u/%u",
+ size = snprintf(to, sizeof(to), "%s@%u:%u/%u",
msg.ftn_to, msg.ftn_dest.zone, msg.ftn_dest.net,
msg.ftn_dest.node);
if (msg.ftn_dest.point)