Exemplo n.º 1
0
static void do_conference_wide_scan(void)
{
	int i, cm;
		
	if (!isanybasestagged(conference()->conf.CONF_NUMBER)) {
		ddprintf("%s", errstr[TS_NO_BASES_TAGGED]);
		return;
	}
	
	cm = current_msgbase->MSGBASE_NUMBER;
		
	for (i = 1; i <= conference()->conf.CONF_MSGBASES; i++) {
		if (!isbasetagged(conference()->conf.CONF_NUMBER, i))
			continue;
		scan_msgbase(i);
	}
	
	changemsgbase(cm, MC_QUICK | MC_NOSTAT);
}
Exemplo n.º 2
0
int tagmessageareas(void)
{
	uint8_t backup[32];
	char tbuf[500];
	const char *sta;
	msgbase_t *mb;
	int bcnt;
	char inp[90];
	const char *s;
	char tok[90];
        int screenl;        

	int i, j;

	memcpy(backup, &selcfg[(conference()->conf.CONF_NUMBER - 1) * 32],
	       sizeof backup);
	       
	vagain:
	DDPut("");

	screenl = user.user_screenlength;
	bcnt = conference()->conf.CONF_MSGBASES;

	for (i = j = 0; j < bcnt; j++) {
		mb = conference()->msgbases[j];
		
		i++;
		if (i == 3) {
			DDPut("\n");
			i = 1;
			screenl--;
			if (screenl == 1) {
				int hot;

				DDPut(sd[morepromptstr]);
				hot = HotKey(0);
				DDPut("\r                                                         \r");
				if (hot == 'N' || hot == 'n' || !checkcarrier())
					break;
				if (hot == 'C' || hot == 'c') {
					screenl = 20000000;
				} else {
					screenl = user.user_screenlength;
				}
			}
		}
		if (isbasetagged(conference()->conf.CONF_NUMBER, mb->MSGBASE_NUMBER)) {
			sta = "ON";
		} else
			sta = "OFF";

		ddprintf(sd[tbclinestr], mb->MSGBASE_NUMBER, mb->MSGBASE_NAME, sta);
	}

	DDPut("\n");
	for (;;) {
		DDPut(sd[tbpromptstr]);
		inp[0] = 0;
		if (!(Prompt(inp, 80, 0)))
			return 0;
		s = inp;
		if (!*inp) {
			strlcpy(inp, "s", sizeof inp);
		}
		
		for (;;) {
			if (strtoken(tok, &s, sizeof tok) > sizeof tok)
				continue;
			if (!*tok)
				break;

			if (!strcasecmp(tok, "c")) {
				memcpy(&selcfg[(conference()->conf.CONF_NUMBER - 1) * 32],
				       backup, sizeof backup);
				
				return 0;
			} else if (!strcasecmp(tok, "v")) {
				goto vagain;
			} else if (!strcasecmp(tok, "s")) {
				int selfd;
				snprintf(tbuf, sizeof tbuf,
					"users/%d/selected.dat", 
					user.user_account_id);
				selfd = open(tbuf, O_WRONLY | O_CREAT, 0666);
				if (selfd != -1) {
					fsetperm(selfd, 0666);
					safe_write(selfd, &selcfg, 2056);
					close(selfd);
				}
				return 0;
			} else if (!strcasecmp(tok, "-")) {
				for (i = 0; i < 32; i++) {
					selcfg[((conference()->conf.CONF_NUMBER - 1) * 32) + i] = 0;
				}
				DDPut(sd[tballoffstr]);
			} else if (!strcasecmp(tok, "+")) {
				bcnt = conference()->conf.CONF_MSGBASES;
				
				for (i = 0; i < bcnt; i++) {
					mb = conference()->msgbases[i];
					selcfg[((conference()->conf.CONF_NUMBER - 1) * 32) + (mb->MSGBASE_NUMBER - 1) / 8] |= (1L << (mb->MSGBASE_NUMBER - 1) % 8);
				}
				DDPut(sd[tballonstr]);
			} else {
				i = atoi(tok);
				if (i) {
					for (j = 0; j < conference()->conf.CONF_MSGBASES; j++) {
						mb = conference()->msgbases[j];
						if (i == mb->MSGBASE_NUMBER) {
							if (selcfg[((conference()->conf.CONF_NUMBER - 1) * 32) + (mb->MSGBASE_NUMBER - 1) / 8] & (1L << (mb->MSGBASE_NUMBER - 1) % 8)) {
								selcfg[((conference()->conf.CONF_NUMBER - 1) * 32) + (mb->MSGBASE_NUMBER - 1) / 8] &= ~(1L << (mb->MSGBASE_NUMBER - 1) % 8);
							} else {
								selcfg[((conference()->conf.CONF_NUMBER - 1) * 32) + (mb->MSGBASE_NUMBER - 1) / 8] |= (1L << (mb->MSGBASE_NUMBER - 1) % 8);
							}
							break;
						}
					}

				}
			}
		}
	}
}