summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Hibberd <hibby@debian.org>2024-02-23 21:36:36 +0000
committerDave Hibberd <hibby@debian.org>2024-02-23 21:36:36 +0000
commite8c2a57f79bfd30689a45bcb8bc07998edcee773 (patch)
tree6956703ff87fcf419db08f7d6d981e291fefa258
parentb8e40a44c95ea6e9933a130e9465eb98fa650aed (diff)
New upstream version 6.0.24.30upstream/6.0.24.30
-rw-r--r--BPQChat.vcproj.SKIGACER.johnw.user65
-rw-r--r--BPQMail.c2
-rw-r--r--Bpq32.c2
-rw-r--r--CBPQ32.vcproj.NOTTSDESKTOP.John.user2
-rw-r--r--MailRouting.c305
-rw-r--r--Versions.h4
-rw-r--r--WebMail.c113
-rw-r--r--httpconnectioninfo.h2
-rw-r--r--templatedefs.c2
9 files changed, 356 insertions, 141 deletions
diff --git a/BPQChat.vcproj.SKIGACER.johnw.user b/BPQChat.vcproj.SKIGACER.johnw.user
new file mode 100644
index 0000000..b5b0536
--- /dev/null
+++ b/BPQChat.vcproj.SKIGACER.johnw.user
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+ ProjectType="Visual C++"
+ Version="8.00"
+ ShowAllFiles="false"
+ >
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ >
+ <DebugSettings
+ Command="$(TargetPath)"
+ WorkingDirectory=""
+ CommandArguments=""
+ Attach="false"
+ DebuggerType="3"
+ Remote="1"
+ RemoteMachine="SKIGACER"
+ RemoteCommand=""
+ HttpUrl=""
+ PDBPath=""
+ SQLDebugging=""
+ Environment=""
+ EnvironmentMerge="true"
+ DebuggerFlavor=""
+ MPIRunCommand=""
+ MPIRunArguments=""
+ MPIRunWorkingDirectory=""
+ ApplicationCommand=""
+ ApplicationArguments=""
+ ShimCommand=""
+ MPIAcceptMode=""
+ MPIAcceptFilter=""
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ >
+ <DebugSettings
+ Command="$(TargetPath)"
+ WorkingDirectory=""
+ CommandArguments=""
+ Attach="false"
+ DebuggerType="3"
+ Remote="1"
+ RemoteMachine="SKIGACER"
+ RemoteCommand=""
+ HttpUrl=""
+ PDBPath=""
+ SQLDebugging=""
+ Environment=""
+ EnvironmentMerge="true"
+ DebuggerFlavor=""
+ MPIRunCommand=""
+ MPIRunArguments=""
+ MPIRunWorkingDirectory=""
+ ApplicationCommand=""
+ ApplicationArguments=""
+ ShimCommand=""
+ MPIAcceptMode=""
+ MPIAcceptFilter=""
+ />
+ </Configuration>
+ </Configurations>
+</VisualStudioUserFile>
diff --git a/BPQMail.c b/BPQMail.c
index 8408217..91b66ba 100644
--- a/BPQMail.c
+++ b/BPQMail.c
@@ -1127,6 +1127,8 @@
// Start adding json api (25)
// Fix reading nested directories when loading Standard Templates and other template bugs (25)
// Add TO and AT to "Message has nowhere to go" message (28)
+// Add My Sent and My Received filter options to Webmail (30)
+// Add Send P to multiple BBS's when routing on HR (30)
#include "bpqmail.h"
#include "winstdint.h"
diff --git a/Bpq32.c b/Bpq32.c
index 576f6be..d826062 100644
--- a/Bpq32.c
+++ b/Bpq32.c
@@ -1208,7 +1208,7 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
// Disable CTS check in WriteComBlock (26)
// Improvments to reporting to M0LTE Map (26)
// IPGateway fix from github user isavitsky (27)
-// Fix possible crash in SCSPactor PTCPORT code (29)
+// Fix possible crash in SCSPactor PTCPORT code (29)
#define CKernel
diff --git a/CBPQ32.vcproj.NOTTSDESKTOP.John.user b/CBPQ32.vcproj.NOTTSDESKTOP.John.user
index f4ba73a..270b67b 100644
--- a/CBPQ32.vcproj.NOTTSDESKTOP.John.user
+++ b/CBPQ32.vcproj.NOTTSDESKTOP.John.user
@@ -37,7 +37,7 @@
Name="Release|Win32"
>
<DebugSettings
- Command=""
+ Command="C:\Devprogs\BPQ32\bpq32.exe"
WorkingDirectory=""
CommandArguments=""
Attach="false"
diff --git a/MailRouting.c b/MailRouting.c
index 27dc162..b353cc5 100644
--- a/MailRouting.c
+++ b/MailRouting.c
@@ -1398,6 +1398,7 @@ NOHA:
int bestmatch = 0;
int depth;
int Matched = 0;
+ int MultiPDepth = 0;
for (bbs = BBSChain; bbs; bbs = bbs->BBSNext)
{
@@ -1467,7 +1468,49 @@ NOHA:
}
// We should choose the BBS with most matching elements (ie match on #23.GBR better that GBR)
- // If SendPtoMultiple is set I think we send to any with same mtch level
+ // If SendPtoMultiple is set I think we send to any with same match level
+
+ // So if SendPtoMultiple is set I think I need to find the best depth then send to all with the same depth
+
+
+ if (SendPtoMultiple && Msg->type == 'P')
+ {
+ Logprintf(LOG_BBS, conn, '?', "SendPtoMultiple is set. Checking for best match level");
+
+ for (bbs = BBSChain; bbs; bbs = bbs->BBSNext)
+ {
+ ForwardingInfo = bbs->ForwardingInfo;
+
+ depth = CheckBBSHElements(Msg, bbs, ForwardingInfo, ATBBS, &HElements[0]);
+
+ if (depth)
+ {
+ if (depth > MultiPDepth)
+ {
+ MultiPDepth = depth;
+ bestbbs = bbs;
+ }
+ }
+
+ if (MultiPDepth)
+ {
+ for (bbs = BBSChain; bbs; bbs = bbs->BBSNext)
+ {
+ ForwardingInfo = bbs->ForwardingInfo;
+
+ depth = CheckBBSHElements(Msg, bbs, ForwardingInfo, ATBBS, &HElements[0]);
+
+ if (depth == MultiPDepth)
+ {
+ Logprintf(LOG_BBS, conn, '?', "Routing Trace HR Matches BBS %s Depth %d", bbs->Call, depth);
+ CheckAndSend(Msg, conn, bbs);
+ }
+ }
+
+ return 1;
+ }
+ }
+ }
for (bbs = BBSChain; bbs; bbs = bbs->BBSNext)
{
@@ -1481,7 +1524,7 @@ NOHA:
if (depth)
{
Logprintf(LOG_BBS, conn, '?', "Routing Trace HR Matches BBS %s Depth %d", bbs->Call, depth);
-
+
if (depth > bestmatch)
{
bestmatch = depth;
@@ -1494,14 +1537,14 @@ NOHA:
Logprintf(LOG_BBS, conn, '?', "Routing Trace HR Best Match is %s", bestbbs->Call);
CheckAndSend(Msg, conn, bestbbs);
-
+
return 1;
}
// Check for wildcarded AT address
-// if (ATBBS[0] == 0)
-// return FALSE; // no AT
+ // if (ATBBS[0] == 0)
+ // return FALSE; // no AT
CheckWildCardedAT:
@@ -1521,7 +1564,7 @@ CheckWildCardedAT:
if (depth > -1)
{
Logprintf(LOG_BBS, conn, '?', "Routing Trace Wildcarded AT Matches %s Length %d", bbs->Call, depth);
-
+
if (depth > bestmatch)
{
bestmatch = depth;
@@ -1543,182 +1586,182 @@ CheckWildCardedAT:
Logprintf(LOG_BBS, conn, '?', "Routing Trace - No Match");
return FALSE; // No match
- }
-
- // Flood Bulls go to all matching BBSs in the flood area, so the order of checking doesn't matter
+ }
- // For now I will only route on AT (for non-hierarchical addresses) and HA
+ // Flood Bulls go to all matching BBSs in the flood area, so the order of checking doesn't matter
- // Ver 1.0.4.2 - Try including TO
+ // For now I will only route on AT (for non-hierarchical addresses) and HA
- for (bbs = BBSChain; bbs; bbs = bbs->BBSNext)
- {
- ForwardingInfo = bbs->ForwardingInfo;
+ // Ver 1.0.4.2 - Try including TO
- if (ForwardingInfo->PersonalOnly)
- continue;
+ for (bbs = BBSChain; bbs; bbs = bbs->BBSNext)
+ {
+ ForwardingInfo = bbs->ForwardingInfo;
- if (CheckBBSToList(Msg, bbs, ForwardingInfo))
- {
- Logprintf(LOG_BBS, conn, '?', "Routing Trace TO %s Matches BBS %s", Msg->to, bbs->Call);
+ if (ForwardingInfo->PersonalOnly)
+ continue;
- if (ForwardToMe || _stricmp(bbs->Call, BBSName) != 0) // Dont forward to ourself - already here! (unless ForwardToMe set)
+ if (CheckBBSToList(Msg, bbs, ForwardingInfo))
{
- set_fwd_bit(Msg->fbbs, bbs->BBSNumber);
- ForwardingInfo->MsgCount++;
+ Logprintf(LOG_BBS, conn, '?', "Routing Trace TO %s Matches BBS %s", Msg->to, bbs->Call);
+
+ if (ForwardToMe || _stricmp(bbs->Call, BBSName) != 0) // Dont forward to ourself - already here! (unless ForwardToMe set)
+ {
+ set_fwd_bit(Msg->fbbs, bbs->BBSNumber);
+ ForwardingInfo->MsgCount++;
+ }
+ Count++;
+ continue;
}
- Count++;
- continue;
- }
- if ((strcmp(ATBBS, bbs->Call) == 0) || // @BBS = BBS
- CheckBBSAtList(Msg, ForwardingInfo, ATBBS))
- {
- Logprintf(LOG_BBS, conn, '?', "Routing Trace AT %s Matches BBS %s", Msg->to, bbs->Call);
- CheckAndSend(Msg, conn, bbs);
+ if ((strcmp(ATBBS, bbs->Call) == 0) || // @BBS = BBS
+ CheckBBSAtList(Msg, ForwardingInfo, ATBBS))
+ {
+ Logprintf(LOG_BBS, conn, '?', "Routing Trace AT %s Matches BBS %s", Msg->to, bbs->Call);
+ CheckAndSend(Msg, conn, bbs);
- Count++;
- continue;
- }
-
-
- if (CheckBBSHElementsFlood(Msg, bbs, ForwardingInfo, Msg->via, &HElements[0]))
- {
- Logprintf(LOG_BBS, conn, '?', "Routing Trace HR %s %s %s %s %s Matches BBS %s",
- HElements[0], HElements[1], HElements[2],
- HElements[3], HElements[4], bbs->Call);
-
- CheckAndSend(Msg, conn, bbs);
+ Count++;
+ continue;
+ }
- Count++;
- }
- }
+ if (CheckBBSHElementsFlood(Msg, bbs, ForwardingInfo, Msg->via, &HElements[0]))
+ {
+ Logprintf(LOG_BBS, conn, '?', "Routing Trace HR %s %s %s %s %s Matches BBS %s",
+ HElements[0], HElements[1], HElements[2],
+ HElements[3], HElements[4], bbs->Call);
- if (Count == 0)
- goto CheckWildCardedAT;
+ CheckAndSend(Msg, conn, bbs);
- Logprintf(LOG_BBS, conn, '?', "Routing Trace - No Match");
+ Count++;
+ }
- return Count;
-}
+ }
-BOOL CheckBBSToList(struct MsgInfo * Msg, struct UserInfo * bbs, struct BBSForwardingInfo * ForwardingInfo)
-{
- char ** Calls;
+ if (Count == 0)
+ goto CheckWildCardedAT;
- // Check TO distributions
+ Logprintf(LOG_BBS, conn, '?', "Routing Trace - No Match");
- if (ForwardingInfo->TOCalls)
+ return Count;
+ }
+
+ BOOL CheckBBSToList(struct MsgInfo * Msg, struct UserInfo * bbs, struct BBSForwardingInfo * ForwardingInfo)
{
- Calls = ForwardingInfo->TOCalls;
+ char ** Calls;
- while(Calls[0])
+ // Check TO distributions
+
+ if (ForwardingInfo->TOCalls)
{
- if (strcmp(Calls[0], Msg->to) == 0)
- return TRUE;
+ Calls = ForwardingInfo->TOCalls;
- Calls++;
+ while(Calls[0])
+ {
+ if (strcmp(Calls[0], Msg->to) == 0)
+ return TRUE;
+
+ Calls++;
+ }
}
+ return FALSE;
}
- return FALSE;
-}
-BOOL CheckBBSAtList(struct MsgInfo * Msg, struct BBSForwardingInfo * ForwardingInfo, char * ATBBS)
-{
- char ** Calls;
+ BOOL CheckBBSAtList(struct MsgInfo * Msg, struct BBSForwardingInfo * ForwardingInfo, char * ATBBS)
+ {
+ char ** Calls;
- // Check AT distributions
+ // Check AT distributions
-// if (strcmp(ATBBS, bbs->Call) == 0) // @BBS = BBS
-// return TRUE;
+ // if (strcmp(ATBBS, bbs->Call) == 0) // @BBS = BBS
+ // return TRUE;
- if (ForwardingInfo->ATCalls)
- {
- Calls = ForwardingInfo->ATCalls;
-
- while(Calls[0])
+ if (ForwardingInfo->ATCalls)
{
- if (strcmp(Calls[0], ATBBS) == 0)
- return TRUE;
+ Calls = ForwardingInfo->ATCalls;
- Calls++;
+ while(Calls[0])
+ {
+ if (strcmp(Calls[0], ATBBS) == 0)
+ return TRUE;
+
+ Calls++;
+ }
}
+ return FALSE;
}
- return FALSE;
-}
-int CheckBBSHElements(struct MsgInfo * Msg, struct UserInfo * bbs, struct BBSForwardingInfo * ForwardingInfo, char * ATBBS, char ** HElements)
-{
- // Used for Personal Messages, and Bulls not yot at their target area
-
- char *** HRoutes;
- int i = 0, j, k = 0;
- int bestmatch = 0;
-
- if (ForwardingInfo->HADDRSP)
+ int CheckBBSHElements(struct MsgInfo * Msg, struct UserInfo * bbs, struct BBSForwardingInfo * ForwardingInfo, char * ATBBS, char ** HElements)
{
- // Match on Routes
+ // Used for Personal Messages, and Bulls not yot at their target area
- HRoutes = ForwardingInfo->HADDRSP;
- k=0;
+ char *** HRoutes;
+ int i = 0, j, k = 0;
+ int bestmatch = 0;
- while(HRoutes[k])
+ if (ForwardingInfo->HADDRSP)
{
- i = j = 0;
-
- while (HRoutes[k][i] && HElements[j]) // Until one set runs out
- {
- if (strcmp(HRoutes[k][i], HElements[j]) != 0)
- break;
- i++;
- j++;
- }
+ // Match on Routes
- // Only send if all BBS elements match
+ HRoutes = ForwardingInfo->HADDRSP;
+ k=0;
- if (HRoutes[k][i] == 0)
+ while(HRoutes[k])
{
- if (i > bestmatch)
+ i = j = 0;
+
+ while (HRoutes[k][i] && HElements[j]) // Until one set runs out
+ {
+ if (strcmp(HRoutes[k][i], HElements[j]) != 0)
+ break;
+ i++;
+ j++;
+ }
+
+ // Only send if all BBS elements match
+
+ if (HRoutes[k][i] == 0)
+ {
+ if (i > bestmatch)
bestmatch = i;
+ }
+ k++;
}
- k++;
}
+ return bestmatch;
}
- return bestmatch;
-}
-int CheckBBSHElementsFlood(struct MsgInfo * Msg, struct UserInfo * bbs, struct BBSForwardingInfo * ForwardingInfo, char * ATBBS, char ** HElements)
-{
- char *** HRoutes;
- char ** BBSHA;
+ int CheckBBSHElementsFlood(struct MsgInfo * Msg, struct UserInfo * bbs, struct BBSForwardingInfo * ForwardingInfo, char * ATBBS, char ** HElements)
+ {
+ char *** HRoutes;
+ char ** BBSHA;
- int i = 0, j, k = 0;
- int bestmatch = 0;
+ int i = 0, j, k = 0;
+ int bestmatch = 0;
- if (ForwardingInfo->HADDRS)
- {
- // Match on Routes
+ if (ForwardingInfo->HADDRS)
+ {
+ // Match on Routes
- // Message must be in right area (all elements of message match BBS Location HA)
+ // Message must be in right area (all elements of message match BBS Location HA)
- BBSHA = ForwardingInfo->BBSHAElements;
+ BBSHA = ForwardingInfo->BBSHAElements;
- if (BBSHA == NULL)
- return 0; // Not safe to flood
-
- i = j = 0;
-
- while (BBSHA[i] && HElements[j]) // Until one set runs out
- {
- if (strcmp(BBSHA[i], HElements[j]) != 0)
- break;
- i++;
- j++;
- }
-
- if (HElements[j] != 0)
+ if (BBSHA == NULL)
+ return 0; // Not safe to flood
+
+ i = j = 0;
+
+ while (BBSHA[i] && HElements[j]) // Until one set runs out
+ {
+ if (strcmp(BBSHA[i], HElements[j]) != 0)
+ break;
+ i++;
+ j++;
+ }
+
+ if (HElements[j] != 0)
return 0; // Message is not for BBS's area
HRoutes = ForwardingInfo->HADDRS;
diff --git a/Versions.h b/Versions.h
index e3200b9..0c9ebab 100644
--- a/Versions.h
+++ b/Versions.h
@@ -10,8 +10,8 @@
#endif
-#define KVers 6,0,24,29
-#define KVerstring "6.0.24.29\0"
+#define KVers 6,0,24,30
+#define KVerstring "6.0.24.30\0"
#ifdef CKernel
diff --git a/WebMail.c b/WebMail.c
index 157938b..f493c06 100644
--- a/WebMail.c
+++ b/WebMail.c
@@ -928,6 +928,22 @@ int SendWebMailHeaderEx(char * Reply, char * Key, struct HTTPConnectionInfo * Se
continue;
}
+ if (Session->WebMailMyTX)
+ {
+ // Only list if to or from me
+
+ if (strcmp(User->Call, Msg->from) != 0)
+ continue;
+ }
+
+ if (Session->WebMailMyRX)
+ {
+ // Only list if to or from me
+
+ if (strcmp(User->Call, Msg->to)!= 0)
+ continue;
+ }
+
if (Count++ < Session->WebMailSkip)
continue;
@@ -959,7 +975,7 @@ int SendWebMailHeaderEx(char * Reply, char * Key, struct HTTPConnectionInfo * Se
if (WebMailTemplate == NULL)
WebMailTemplate = GetTemplateFromFile(6, "WebMailPage.txt");
- return sprintf(Reply, WebMailTemplate, BBSName, User->Call, Key, Key, Key, Key, Key, Key, Key, Key, Messages);
+ return sprintf(Reply, WebMailTemplate, BBSName, User->Call, Key, Key, Key, Key, Key, Key, Key, Key, Key, Key, Messages);
}
int ViewWebMailMessage(struct HTTPConnectionInfo * Session, char * Reply, int Number, BOOL DisplayHTML)
@@ -1617,6 +1633,8 @@ void ProcessWebMailMessage(struct HTTPConnectionInfo * Session, char * Key, BOOL
Session->WebMailLastUsed = time(NULL);
Session->WebMailSkip = 0;
+ Session->WebMailMyTX = FALSE;
+ Session->WebMailMyRX = FALSE;
Session->WebMailMine = FALSE;
if (WebMailTemplate)
@@ -1759,6 +1777,8 @@ void ProcessWebMailMessage(struct HTTPConnectionInfo * Session, char * Key, BOOL
Session->WebMailSkip = 0;
Session->WebMailMine = FALSE;
+ Session->WebMailMyTX = FALSE;
+ Session->WebMailMyRX = FALSE;
*RLen = SendWebMailHeader(Reply, Session->Key, Session);
return;
@@ -1769,6 +1789,8 @@ void ProcessWebMailMessage(struct HTTPConnectionInfo * Session, char * Key, BOOL
Session->WebMailSkip = 0;
Session->WebMailTypes[0] = 0;
Session->WebMailMine = FALSE;
+ Session->WebMailMyTX = FALSE;
+ Session->WebMailMyRX = FALSE;
*RLen = SendWebMailHeader(Reply, Session->Key, Session);
return;
@@ -1779,6 +1801,8 @@ void ProcessWebMailMessage(struct HTTPConnectionInfo * Session, char * Key, BOOL
Session->WebMailSkip = 0;
strcpy(Session->WebMailTypes, "B");
Session->WebMailMine = FALSE;
+ Session->WebMailMyTX = FALSE;
+ Session->WebMailMyRX = FALSE;
*RLen = SendWebMailHeader(Reply, Session->Key, Session);
return;
@@ -1789,6 +1813,8 @@ void ProcessWebMailMessage(struct HTTPConnectionInfo * Session, char * Key, BOOL
Session->WebMailSkip = 0;
strcpy(Session->WebMailTypes, "P");
Session->WebMailMine = FALSE;
+ Session->WebMailMyTX = FALSE;
+ Session->WebMailMyRX = FALSE;
*RLen = SendWebMailHeader(Reply, Session->Key, Session);
return;
@@ -1799,6 +1825,8 @@ void ProcessWebMailMessage(struct HTTPConnectionInfo * Session, char * Key, BOOL
Session->WebMailSkip = 0;
strcpy(Session->WebMailTypes, "T");
Session->WebMailMine = FALSE;
+ Session->WebMailMyTX = FALSE;
+ Session->WebMailMyRX = FALSE;
*RLen = SendWebMailHeader(Reply, Session->Key, Session);
return;
@@ -1809,6 +1837,32 @@ void ProcessWebMailMessage(struct HTTPConnectionInfo * Session, char * Key, BOOL
Session->WebMailSkip = 0;
Session->WebMailTypes[0] = 0;
Session->WebMailMine = TRUE;
+ Session->WebMailMyTX = FALSE;
+ Session->WebMailMyRX = FALSE;
+
+ *RLen = SendWebMailHeader(Reply, Session->Key, Session);
+ return;
+ }
+
+ if (_stricmp(NodeURL, "/WebMail/WMtoMe") == 0)
+ {
+ Session->WebMailSkip = 0;
+ Session->WebMailTypes[0] = 0;
+ Session->WebMailMine = FALSE;
+ Session->WebMailMyTX = FALSE;
+ Session->WebMailMyRX = TRUE;
+
+ *RLen = SendWebMailHeader(Reply, Session->Key, Session);
+ return;
+ }
+
+ if (_stricmp(NodeURL, "/WebMail/WMfromMe") == 0)
+ {
+ Session->WebMailSkip = 0;
+ Session->WebMailTypes[0] = 0;
+ Session->WebMailMine = TRUE;
+ Session->WebMailMyTX = TRUE;
+ Session->WebMailMyRX = FALSE;
*RLen = SendWebMailHeader(Reply, Session->Key, Session);
return;
@@ -1897,6 +1951,8 @@ void ProcessWebMailMessage(struct HTTPConnectionInfo * Session, char * Key, BOOL
"<td><a href=/WebMail/WMT?%s>NTS</a></td>\r\n"
"<td><a href=/WebMail/WMALL?%s>All Types</a></td>\r\n"
"<td><a href=/WebMail/WMMine?%s>Mine</a></td>\r\n"
+ "<td><a href=/WebMail/WMfromMe?%s>My Sent</a></td>\r\n"
+ "<td><a href=/WebMail/WMtoMe?%s>My Rxed</a></td>\r\n"
"<td><a href=/WebMail/WMAuto?%s>Auto Refresh</a></td>\r\n"
"<td><a href=\"#\" onclick=\"newmsg('%s'); return false;\">Send Message</a></td>\r\n"
"<td><a href=/WebMail/WMLogout?%s>Logout</a></td>\r\n"
@@ -1906,7 +1962,7 @@ void ProcessWebMailMessage(struct HTTPConnectionInfo * Session, char * Key, BOOL
"<div align=left id=main style=overflow:scroll;>Waiting for data...</div>\r\n"
"</body></html>\r\n";
- sprintf(Page, WebSockPage, Key, Key ,BBSName, Session->User->Call, Key, Key, Key, Key, Key, Key, Key, Key);
+ sprintf(Page, WebSockPage, Key, Key ,BBSName, Session->User->Call, Key, Key, Key, Key, Key, Key, Key, Key, Key, Key);
*RLen = sprintf(Reply, "%s", Page);
return;
@@ -2099,9 +2155,24 @@ void ProcessWebMailMessage(struct HTTPConnectionInfo * Session, char * Key, BOOL
continue;
}
+ if (Session->WebMailMyTX)
+ {
+ // Only list if to or from me
+
+ if (strcmp(User->Call, Msg->from) != 0)
+ continue;
+ }
+
+ if (Session->WebMailMyRX)
+ {
+ // Only list if to or from me
+
+ if (strcmp(User->Call, Msg->to) != 0)
+ continue;
+ }
*RLen = ViewWebMailMessage(Session, Reply, m, TRUE);
- return;
+ return;
}
}
@@ -2123,10 +2194,10 @@ void ProcessWebMailMessage(struct HTTPConnectionInfo * Session, char * Key, BOOL
for (m = Session->WebMail->CurrentMessageIndex + 1; m <= LatestMsg; m++)
{
Msg = GetMsgFromNumber(m);
-
+
if (Msg == 0 || Msg->type == 0 || Msg->status == 0)
continue; // Protect against corrupt messages
-
+
if (Msg && CheckUserMsg(Msg, User->Call, User->flags & F_SYSOP))
{
// Display if it is the right type and in the page range we want
@@ -2144,9 +2215,24 @@ void ProcessWebMailMessage(struct HTTPConnectionInfo * Session, char * Key, BOOL
continue;
}
+ if (Session->WebMailMyTX)
+ {
+ // Only list if to or from me
+
+ if (strcmp(User->Call, Msg->from) != 0)
+ continue;
+ }
+
+ if (Session->WebMailMyRX)
+ {
+ // Only list if to or from me
+
+ if (strcmp(User->Call, Msg->to) != 0)
+ continue;
+ }
*RLen = ViewWebMailMessage(Session, Reply, m, TRUE);
- return;
+ return;
}
}
@@ -6181,6 +6267,21 @@ int ProcessWebmailWebSock(char * MsgPtr, char * OutBuffer)
continue;
}
+ if (Session->WebMailMyTX)
+ {
+ // Only list if to or from me
+
+ if (strcmp(User->Call, Msg->from) != 0)
+ continue;
+ }
+
+ if (Session->WebMailMyRX)
+ {
+ // Only list if to or from me
+
+ if (strcmp(User->Call, Msg->to) != 0)
+ continue;
+ }
if (Count++ < Session->WebMailSkip)
continue;
diff --git a/httpconnectioninfo.h b/httpconnectioninfo.h
index 8ad1b37..46cb0b7 100644
--- a/httpconnectioninfo.h
+++ b/httpconnectioninfo.h
@@ -38,6 +38,8 @@ struct HTTPConnectionInfo // Used for Web Server for thread-specific stuff
int WebMailSkip; // Number to skip at start of list (for paging)
char WebMailTypes[4]; // Types To List
BOOL WebMailMine; // List all meessage to or from me
+ BOOL WebMailMyTX; // List all meessage from me
+ BOOL WebMailMyRX; // List all meessage to me
time_t WebMailLastUsed;
struct TNCINFO * TNC; // Session -> TNC link
};
diff --git a/templatedefs.c b/templatedefs.c
index dbd7485..94f69e8 100644
--- a/templatedefs.c
+++ b/templatedefs.c
@@ -395,6 +395,8 @@ char * WebMailPagetxt()
"<td><a href=/WebMail/WMT?%s>NTS</a></td>\r\n"
"<td><a href=/WebMail/WMALL?%s>All Types</a></td>\r\n"
"<td><a href=/WebMail/WMMine?%s>Mine</a></td>\r\n"
+ "<td><a href=/WebMail/WMfromMe?%s>My Sent</a></td>\r\n"
+ "<td><a href=/WebMail/WMtoMe?%s>My Rxed</a></td>\r\n"
"<td><a href=/WebMail/WMAuto?%s>Auto Refresh</a></td>\r\n"
"<td><a href=\"#\" onclick=\"newmsg('%s'); return false;\">Send Message</a></td>\r\n"
"<td><a href=/WebMail/WMLogout?%s>Logout</a></td>\r\n"