mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-21 22:26:21 +00:00
feat: Add /force-encryption command and update message handling
Implement /force-encryption command to configure forced encryption settings with on|off and policy resend-to-confirm|block options. The changes enhance user experience by clarifying encryption requirements and providing actionable commands. Users can now press Enter again to confirm unencrypted messages in resend-to-confirm mode.
This commit is contained in:
@@ -2729,6 +2729,7 @@ static const struct cmd_t command_defs[] = {
|
||||
{ "os on|off", "Choose whether to include the OS name if a user asks for software information (XEP-0092)." }
|
||||
)
|
||||
CMD_EXAMPLES(
|
||||
"/privacy",
|
||||
"/privacy logging off",
|
||||
"/privacy os off")
|
||||
},
|
||||
@@ -2744,6 +2745,31 @@ static const struct cmd_t command_defs[] = {
|
||||
"Redraw user interface. Can be used when some other program interrupted profanity or wrote to the same terminal and the interface looks \"broken\"." )
|
||||
},
|
||||
|
||||
{ CMD_PREAMBLE("/force-encryption",
|
||||
parse_args, 1, 3, &cons_encryption_setting)
|
||||
CMD_MAINFUNC(cmd_force_encryption)
|
||||
CMD_TAGS(
|
||||
CMD_TAG_CHAT)
|
||||
CMD_SYN(
|
||||
"/force-encryption",
|
||||
"/force-encryption on|off",
|
||||
"/force-encryption policy resend-to-confirm|block")
|
||||
CMD_DESC(
|
||||
"Configure forced encryption for outgoing messages in CProof. "
|
||||
"When enabled, restricts sending unencrypted messages based on the specified policy. "
|
||||
"Run without arguments to display current settings.")
|
||||
CMD_ARGS(
|
||||
{ "on|off", "Enable or disable forced encryption. When enabled, restricts unencrypted messages per the policy. When disabled, allows sending unencrypted messages without restrictions." },
|
||||
{ "policy resend-to-confirm|block", "Set the policy for unencrypted messages when forced encryption is enabled. 'resend-to-confirm' requires pressing Enter again to confirm sending an unencrypted message (default). 'block' prevents sending unencrypted messages entirely." }
|
||||
)
|
||||
CMD_EXAMPLES(
|
||||
"/force-encryption",
|
||||
"/force-encryption on",
|
||||
"/force-encryption off",
|
||||
"/force-encryption policy resend-to-confirm",
|
||||
"/force-encryption policy block")
|
||||
},
|
||||
|
||||
// NEXT-COMMAND (search helper)
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user