From 8f3f88617dd5b3cff68a633a41edaf990b040e7e Mon Sep 17 00:00:00 2001 From: rswindell <> Date: Mon, 13 Apr 2020 05:05:08 +0000 Subject: [PATCH] Include the protocol and the IP address (if hostname is "<no name>") in the download notification short-mesage (telegram) sent to an uploader from user_downloaded_file(). --- src/sbbs3/userdat.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/sbbs3/userdat.c b/src/sbbs3/userdat.c index a1af00d11a..3e58c79388 100644 --- a/src/sbbs3/userdat.c +++ b/src/sbbs3/userdat.c @@ -2341,17 +2341,26 @@ BOOL user_downloaded_file(scfg_t* cfg, user_t* user, client_t* client, if(cfg->text != NULL) { char str[256]; char tmp[128]; + char prefix[128]=""; ultoac(mod,tmp); char username[64]; - if(client != NULL && uploader.level >= SYSOP_LEVEL) - SAFEPRINTF2(username,"%s [%s]", user->alias, client->host); - else + if(client != NULL && uploader.level >= SYSOP_LEVEL) { + if(client->host != NULL && strcmp(client->host, STR_NO_HOSTNAME) != 0) + SAFEPRINTF2(username,"%s [%s]", user->alias, client->host); + else + SAFEPRINTF2(username,"%s [%s]", user->alias, client->addr); + } else SAFECOPY(username, user->alias); + if(strcmp(cfg->dir[f.dir]->code, "TEMP") == 0 || bytes < (ulong)f.size) + SAFECOPY(prefix, cfg->text[Partially]); + if(client != NULL) { + SAFECAT(prefix, client->protocol); + SAFECAT(prefix, "-"); + } /* Inform uploader of downloaded file */ SAFEPRINTF4(str, cfg->text[DownloadUserMsg] ,getfname(filename) - ,(strcmp(cfg->dir[f.dir]->code, "TEMP") == 0) - || (bytes < (ulong)f.size) ? cfg->text[Partially] : nulstr + ,prefix ,username, tmp); putsmsg(cfg, uploader.number, str); } -- GitLab