add password option messages

This commit is contained in:
Aine
2022-09-23 11:28:15 +03:00
parent 4bf0f0dee3
commit c56c740c1d

View File

@@ -65,11 +65,11 @@ func (b *Bot) getOption(ctx context.Context, name string) {
"To set it to a new value, send a `%s %s VALUE` command.", "To set it to a new value, send a `%s %s VALUE` command.",
name, value, b.prefix, name) name, value, b.prefix, name)
if name == roomOptionPassword { if name == roomOptionPassword {
msg = fmt.Sprintf("Password hash of this room is `%s`\n"+ msg = fmt.Sprintf("There is an SMTP password already set for this room/mailbox. "+
"To set it to a new value, send a `%s %s VALUE` command.\n\n"+ "It's stored in a secure hashed manner, so we can't tell you what the original raw password was. "+
"---\n\n"+ "To find the raw password, try to find your old message which had originally set it, "+
"**Please, remove that message after reading.**", "or just set a new one with `%s %s NEW_PASSWORD`.",
value, b.prefix, name) b.prefix, name)
} }
b.SendNotice(ctx, evt.RoomID, msg) b.SendNotice(ctx, evt.RoomID, msg)
} }
@@ -124,8 +124,7 @@ func (b *Bot) setOption(ctx context.Context, name, value string) {
msg := fmt.Sprintf("`%s` of this room set to `%s`", name, value) msg := fmt.Sprintf("`%s` of this room set to `%s`", name, value)
if name == roomOptionPassword { if name == roomOptionPassword {
msg = msg + "\n\n---\n\n" + msg = "SMTP password has been set"
"**Please, remove that message and the previous one.**"
} }
b.SendNotice(ctx, evt.RoomID, msg) b.SendNotice(ctx, evt.RoomID, msg)
} }