projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9030b1a
)
In the text client - fixed the logic for determining whether to display the email...
author
Art Cancro
<ajc@citadel.org>
Thu, 10 Dec 2020 04:22:21 +0000
(23:22 -0500)
committer
Art Cancro
<ajc@citadel.org>
Thu, 10 Dec 2020 04:22:21 +0000
(23:22 -0500)
textclient/messages.c
patch
|
blob
|
history
diff --git
a/textclient/messages.c
b/textclient/messages.c
index 731854b3a69d6c3d3c870f7b28a83aae852436b1..7fd9502df3831326b3c2afff2563fada38dc121b 100644
(file)
--- a/
textclient/messages.c
+++ b/
textclient/messages.c
@@
-1,7
+1,7
@@
/*
* Text client functions for reading and writing of messages
*
/*
* Text client functions for reading and writing of messages
*
- * Copyright (c) 1987-20
19
by the citadel.org team
+ * Copyright (c) 1987-20
20
by the citadel.org team
*
* This program is open source software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3.
*
* This program is open source software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3.
@@
-410,6
+410,7
@@
int read_message(CtdlIPC *ipc,
char ch;
int linelen;
int final_line_is_blank = 0;
char ch;
int linelen;
int final_line_is_blank = 0;
+ int is_local = 0;
has_images = 0;
has_images = 0;
@@
-444,6
+445,18
@@
int read_message(CtdlIPC *ipc,
color(BRIGHT_CYAN);
}
color(BRIGHT_CYAN);
}
+ /* Determine if the message originated here on the local system. If it did we will suppress printing of email addresses */
+ is_local = 0;
+ char *at = !IsEmptyStr(message->email) ? strchr(message->email,'@') : NULL;
+ if (at) {
+ if (!strcasecmp(++at, ipc->ServInfo.fqdn)) {
+ is_local = 1;
+ }
+ }
+ else {
+ is_local = 1; // no address means it couldn't have originated anywhere else
+ }
+
/* View headers only */
if (pagin == 2) {
scr_printf("nhdr=%s\nfrom=%s\ntype=%d\nmsgn=%s\n",
/* View headers only */
if (pagin == 2) {
scr_printf("nhdr=%s\nfrom=%s\ntype=%d\nmsgn=%s\n",
@@
-500,7
+513,7
@@
int read_message(CtdlIPC *ipc,
strftime(now, sizeof now, "%F %R", &thetime);
if (dest) {
fprintf(dest, "%s from %s ", now, message->author);
strftime(now, sizeof now, "%F %R", &thetime);
if (dest) {
fprintf(dest, "%s from %s ", now, message->author);
- if (!
IsEmptyStr(message->email)
) {
+ if (!
is_local
) {
fprintf(dest, "<%s> ", message->email);
}
}
fprintf(dest, "<%s> ", message->email);
}
}
@@
-511,7
+524,7
@@
int read_message(CtdlIPC *ipc,
scr_printf("from ");
color(BRIGHT_CYAN);
scr_printf("%s ", message->author);
scr_printf("from ");
color(BRIGHT_CYAN);
scr_printf("%s ", message->author);
- if (!
IsEmptyStr(message->email)
) {
+ if (!
is_local
) {
color(DIM_WHITE);
scr_printf("<");
color(BRIGHT_BLUE);
color(DIM_WHITE);
scr_printf("<");
color(BRIGHT_BLUE);