Esempio n. 1
0
int msgmorebar(char *filename) {
	extern int showansi;
	char title[256];
	int ch;
	showansi = 1;
	move(t_lines - 1, 0);
	clrtoeol();

	prints("ѶϢä¯ÀÀÆ÷   ±£Áô <r>    Çå³ý <c>   ¼Ä»ØÐÅÏä<m>                                ");
	move(t_lines - 1, 0);

	ch = morekey();
	if (ch == 'C') {
		if (askyn("È·¶¨ÒªÇå³ýÂð£¿", NA, YEA) == YEA) {
			unlink(filename);
		}
		return ch;
	} else if (ch == 'M') {
		if (askyn("È·¶¨Òª¼Ä»ØÂð£¿", NA, YEA) == YEA) {
			sprintf(title, "[%s] ËùÓÐѶϢ±¸·Ý", getdatestring(time(NULL), DATE_ZH));
			mail_file(filename, currentuser.userid, title);
			unlink(filename);
		}
		return ch;
	} else if (ch == 'H') {
		show_help("help/msghelp");
	}
	clrtoeol();
	refresh();
	return ch;
}
Esempio n. 2
0
int msgmorebar(char *filename,int mode)
{
	extern int showansi;
	char title[256];
	char oldfilename[STRLEN];
	char cmd[2*STRLEN];
	int     ch;
	time_t  now;
	showansi = 1;
	move(t_lines - 1, 0);
	clrtoeol();
        prints("ѶϢä¯ÀÀÆ÷   ±£Áô <r>    Çå³ý <c>   ¼Ä»ØÐÅÏä<m>                                ");
        move(t_lines - 1, 0);
	ch = morekey();
	if (ch == 'C')
	{
		if(mode==YEA)
                {
                	strcpy(oldfilename,filename);
                        strcat(oldfilename,".old");
                        strcpy(cmd,"mv ");
                        strcat(cmd,filename);
                        strcat(cmd," ");
                        strcat(cmd,oldfilename);
                        system(cmd);
                }
                else
                {
  	        	unlink(filename);
                }
                return ch;
	}
	else if (ch == 'M')
	{
	        now = time(0);
	        getdatestring(now,NA);
	        sprintf(title, "[%s] ËùÓÐѶϢ±¸·Ý", datestring);
	        mail_file(filename, currentuser.userid, title);
	        unlink(filename);
	        return ch;
	}
	else if (ch == 'H')
	{
	        show_help("help/msghelp");
	}
	clrtoeol();
	refresh();
	return ch;
}