Commit 14b116bc authored by rswindell's avatar rswindell
Browse files

Allow message "tagging" (ala hashtags, without the hash).

If a message sub-board is configured to "Allow Message Tagging"
(under Toggle Options in SCFG->Message Areas), then after a message is
posted (via the terminal server), the user will be prompted if they
want to tag the message with one or more space-separated tags. The no/yes
prompt can be skipp if desired by setting the TagMessageQ line in the
text.dat file to an empty string. There is currently no provision for
regular users to actually see/view the message tags (yet), but the sysop
or sub-op can view the tags in the message header with the 'H' sys/sub-op
command.
parent 0eda16b8
......@@ -346,6 +346,19 @@ bool sbbs_t::postmsg(uint subnum, smbmsg_t *remsg, long wm_mode)
if(editor!=NULL)
smb_hfield_str(&msg,SMB_EDITOR,editor);
if(cfg.sub[subnum]->misc&SUB_MSGTAGS
&& (text[TagMessageQ][0]==0 || !noyes(text[TagMessageQ]))) {
char tags[64] = "";
bputs(text[TagMessagePrompt]);
if(getstr(tags, sizeof(tags)-1, K_LINE)) {
truncsp(tags);
char* p = tags;
SKIP_WHITESPACE(p);
if(*p)
smb_hfield_str(&msg, SMB_TAGS, p);
}
}
i=smb_addmsg(&smb,&msg,storage,dupechk_hashes,xlat,(uchar*)msgbuf,NULL);
free(msgbuf);
......
......@@ -222,6 +222,7 @@ typedef struct js_callback {
/* Bit values for sub[x].misc */
#define SUB_NOVOTING (1L<<0) /* No voting allowed in this sub-board */
#define SUB_TEMPLATE (1L<<1) /* Use this sub as template for new subs (in this group) */
#define SUB_MSGTAGS (1L<<2) /* Allow messages to be tagged (ala hashtags) */
#define SUB_QNET (1L<<3) /* Sub-board is netted via QWK network */
#define SUB_PNET (1L<<4) /* Sub-board is netted via PostLink */
#define SUB_FIDO (1L<<5) /* Sub-board is netted via FidoNet */
......
......@@ -542,6 +542,8 @@ void sub_cfg(uint grpnum)
,cfg.sub[i]->misc&SUB_NOVOTING ? "No":"Yes");
sprintf(opt[n++],"%-27.27s%s","Allow Message Quoting"
,cfg.sub[i]->misc&SUB_QUOTE ? "Yes":"No");
sprintf(opt[n++],"%-27.27s%s","Allow Message Tagging"
,cfg.sub[i]->misc&SUB_MSGTAGS ? "Yes":"No");
sprintf(opt[n++],"%-27.27s%s","Suppress User Signatures"
,cfg.sub[i]->misc&SUB_NOUSERSIG ? "Yes":"No");
sprintf(opt[n++],"%-27.27s%s","Permanent Operator Msgs"
......@@ -563,7 +565,7 @@ void sub_cfg(uint grpnum)
"This menu allows you to toggle certain options for the selected\n"
"sub-board between two or more settings, such as `Yes` and `No`.\n"
;
n=uifc.list(WIN_ACT|WIN_SAV|WIN_RHT|WIN_BOT,3,2,36,&tog_dflt,0
n=uifc.list(WIN_ACT|WIN_SAV|WIN_RHT|WIN_BOT,3,1,36,&tog_dflt,0
,"Toggle Options",opt);
if(n==-1)
break;
......@@ -890,6 +892,28 @@ void sub_cfg(uint grpnum)
}
break;
case 11:
n=(cfg.sub[i]->misc&SUB_MSGTAGS) ? 0:1;
uifc.helpbuf=
"`Allow Message Tagging:`\n"
"\n"
"If you want users to be allowed to add tags to messages on this sub-board, \n"
"set this option to `Yes` (not to be confused with 'tag-lines').\n"
;
n=uifc.list(WIN_SAV|WIN_MID,0,0,0,&n,0
,"Allow Message Tagging",uifcYesNoOpts);
if(n==-1)
break;
if(!n && !(cfg.sub[i]->misc&SUB_MSGTAGS)) {
uifc.changes = TRUE;
cfg.sub[i]->misc|=SUB_MSGTAGS;
break;
}
if(n==1 && cfg.sub[i]->misc&SUB_MSGTAGS) {
uifc.changes = TRUE;
cfg.sub[i]->misc&=~SUB_MSGTAGS;
}
break;
case 12:
n=(cfg.sub[i]->misc&SUB_NOUSERSIG) ? 0:1;
uifc.helpbuf=
"Suppress User Signatures:\n"
......@@ -911,7 +935,7 @@ void sub_cfg(uint grpnum)
cfg.sub[i]->misc&=~SUB_NOUSERSIG;
}
break;
case 12:
case 13:
n=(cfg.sub[i]->misc&SUB_SYSPERM) ? 0:1;
uifc.helpbuf=
"`Operator Messages Automatically Permanent:`\n"
......@@ -973,7 +997,7 @@ void sub_cfg(uint grpnum)
}
break;
#endif
case 13:
case 14:
n=(cfg.sub[i]->misc&SUB_LZH) ? 0:1;
uifc.helpbuf=
"`Compress Messages with LZH Encoding:`\n"
......@@ -1002,7 +1026,7 @@ void sub_cfg(uint grpnum)
cfg.sub[i]->misc&=~SUB_LZH;
}
break;
case 14:
case 15:
n=(cfg.sub[i]->misc&SUB_TEMPLATE) ? 0:1;
uifc.helpbuf=
"`Use this Sub-board as a Template for New Subs:`\n"
......
......@@ -813,6 +813,8 @@ enum {
,RemoveFileQ
,OriginFidoAddr
,VoteNoticeFmt
,TagMessageQ
,TagMessagePrompt
,TOTAL_TEXT
};
......
......@@ -1327,4 +1327,7 @@ const char * const text_defaults[TOTAL_TEXT]={
,"\x52\x65\x6d\x6f\x76\x65\x20\x66\x69\x6c\x65" // 800 RemoveFileQ
,"\x4f\x72\x69\x67\x69\x6e\x61\x74\x69\x6e\x67\x20\x41\x64\x64\x72\x65\x73\x73" // 801 OriginFidoAddr
,"\x01\x6e\x01\x68\xfb\x20\x01\x6d\x25\x2e\x37\x37\x73\x0d\x0a" // 802 VoteNoticeFmt
,"\x54\x61\x67\x20\x74\x68\x69\x73\x20\x6d\x65\x73\x73\x61\x67\x65\x3f" // 803 TagMessageQ
,"\x54\x61\x67\x20\x28\x6f\x72\x20\x45\x4e\x54\x45\x52\x20\x74\x6f\x20\x73\x74\x6f\x70\x20\x74\x61\x67\x67\x69\x6e\x67\x29\x3a\x20"
"" // 804 TagMessagePrompt
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment