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

Remove nagging messages about tab-completing names #23

Open
wants to merge 1 commit into
base: lua-experimental
Choose a base branch
from
Open
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
61 changes: 18 additions & 43 deletions src/conio.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,49 +528,24 @@ static void gotkey_real(int c) {
if (namescomplete.foundfirst && !namescomplete.foundmatch)
bufloc = strlen(buf);
else if (namescomplete.foundmatch) {
static char *lastcomplete = NULL;
static int numcompletes = 1;

if (numcompletes && (lastcomplete != NULL) && (strcmp(namescomplete.buf, lastcomplete) == 0)) {
if (numcompletes == 1)
echof(curconn, "TAB", "Please do not complete the same name twice. It is likely that %s already saw your initial address and can track your messages without additional help, or %s did not see your initial message and is not going to hear your followup messages either.\n", lastcomplete, lastcomplete);
else if (numcompletes == 2)
echof(curconn, "TAB", "If you find yourself sending a large number of messages to the same person in a group, it might be best to take the person aside to finish your conversation. Online, this can be accomplished by using <font color=\"#00FF00\">/msg %s yourmessage</font>.\n", lastcomplete);
else if (numcompletes == 3)
echof(curconn, "TAB", "Remember: This is a group you are addressing. If your conversation is directed at only one person, it may be best to hold it in private, using <font color=\"#00FF00\">/msg</font>. If the conversation is for the benefit of the entire audience, you should not prefix every message with an individual's name.\n");
else {
echof(curconn, "TAB", "If you really want to complete the same name multiple times, I'm not going to stop you. However, please try to think of how you would act if you were holding this conversation in person--including moving aside if the group area is too noisy.\n");
numcompletes = 0;
}

if (numcompletes) {
memset(buf, 0, sizeof(buf));
inwhite = inpaste = bufloc = 0;
numcompletes++;
}
free(lastcomplete);
lastcomplete = NULL;
} else {
memset(buf, 0, sizeof(buf));
inwhite = inpaste = bufloc = 0;
for (i = 0; namescomplete.buf[i] != 0; i++)
ADDTOBUF(namescomplete.buf[i]);
if (namescomplete.foundmatch) {
char *delim = getvar(curconn, "addressdelim");

if ((delim != NULL) && (*delim != 0))
ADDTOBUF(*delim);
else
ADDTOBUF(',');
ADDTOBUF(' ');
}
if (namescomplete.foundmult)
bufloc = namescomplete.len;
else
bufloc = strlen(buf);
if (numcompletes)
STRREPLACE(lastcomplete, namescomplete.buf);
}

memset(buf, 0, sizeof(buf));
inwhite = inpaste = bufloc = 0;
for (i = 0; namescomplete.buf[i] != 0; i++)
ADDTOBUF(namescomplete.buf[i]);
if (namescomplete.foundmatch) {
char *delim = getvar(curconn, "addressdelim");

if ((delim != NULL) && (*delim != 0))
ADDTOBUF(*delim);
else
ADDTOBUF(',');
ADDTOBUF(' ');
}
if (namescomplete.foundmult)
bufloc = namescomplete.len;
else
bufloc = strlen(buf);
}
free(namescomplete.buf);
namescomplete.buf = NULL;
Expand Down