Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1636 - adding/deleting/listing user list for multi-email #1643

Merged
merged 1 commit into from
Dec 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 22 additions & 9 deletions bbs/multmail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,16 @@ void add_list(int *pnUserNumber, int *numu, int maxu, int allowdup) {
bout.nl();
bout.outstr("Already in list, not added.\r\n\n");
i = 0;
break;
}
if (i) {
pnUserNumber[(*numu)++] = i;
}
}
}
if (i) {
pnUserNumber[(*numu)++] = i;
}
} else {
if (i) {
pnUserNumber[(*numu)++] = i;
}
}
}
}
Expand All @@ -291,7 +296,7 @@ void add_list(int *pnUserNumber, int *numu, int maxu, int allowdup) {
#define MAX_LIST 40

void slash_e() {
int user_number[MAX_LIST], numu, i;
int user_number[MAX_LIST]={}, numu, i;
char s[81],*sss;

mml_s = nullptr;
Expand All @@ -315,7 +320,7 @@ void slash_e() {
numu = 0;
do {
bout.nl(2);
bout.outstr("|#2Multi-Mail: A,M,D,L,E,Q,? : ");
bout.print("|#2Multi-Mail: List: {} : A,M,D,L,E,Q,? : ",numu);
switch (char ch = onek("QAMDEL?"); ch) {
case '?':
bout.printfile(MMAIL_NOEXT);
Expand All @@ -325,9 +330,11 @@ void slash_e() {
break;
case 'A':
bout.nl();
bout.outstr("Enter names/numbers for users, one per line, max 20.\r\n\n");
bout.print("Enter names/numbers for users, one per line, max {}.\r\n\n",MAX_LIST);
mml_s = nullptr;
add_list(user_number, &numu, MAX_LIST, so());
//add_list(user_number, &numu, MAX_LIST, so());
add_list(user_number, &numu, MAX_LIST, 0); // do we really want sysops
// to be able to add dupe entries?
break;
case 'M': {
FindFiles ff(FilePath(a()->config()->datadir(), "*.mml"), FindFiles::FindFilesType::any);
Expand All @@ -351,7 +358,6 @@ void slash_e() {
bout.nl();
bout.outstr("|#2Which? ");
bin.input(s, 8);

File fileMailList(FilePath(a()->config()->datadir(), s));
if (!fileMailList.Open(File::modeBinary | File::modeReadOnly)) {
bout.nl();
Expand Down Expand Up @@ -383,6 +389,12 @@ void slash_e() {
break;
case 'D':
if (numu) {
bout.nl();
for (i = 0; i < numu; i++) {
User user;
a()->users()->readuser(&user, user_number[i]);
bout.print("{}. {}\r\n", i + 1, a()->names()->UserName(user_number[i]));
}
bout.nl();
bout.outstr("|#2Delete which? ");
bin.input(s, 2);
Expand All @@ -396,6 +408,7 @@ void slash_e() {
}
break;
case 'L':
bout.nl();
for (i = 0; i < numu; i++) {
User user;
a()->users()->readuser(&user, user_number[i]);
Expand Down