Make sure mailbox value is formatted correctly in getOption/setOption
This commit is contained in:
parent
5c443ec7aa
commit
a8e8b23174
1 changed files with 2 additions and 2 deletions
|
|
@ -190,7 +190,7 @@ func (b *Bot) getOption(ctx context.Context, name string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if name == optionMailbox {
|
if name == optionMailbox {
|
||||||
msg = msg + "@" + b.domain
|
value = fmt.Sprintf("%s@%s", value, b.domain)
|
||||||
}
|
}
|
||||||
|
|
||||||
b.Notice(ctx, evt.RoomID, fmt.Sprintf(msg, name, value))
|
b.Notice(ctx, evt.RoomID, fmt.Sprintf(msg, name, value))
|
||||||
|
|
@ -226,7 +226,7 @@ func (b *Bot) setOption(ctx context.Context, name, value string) {
|
||||||
|
|
||||||
cfg.Set(name, value)
|
cfg.Set(name, value)
|
||||||
if name == optionMailbox {
|
if name == optionMailbox {
|
||||||
msg = msg + "@" + b.domain
|
value = fmt.Sprintf("%s@%s", value, b.domain)
|
||||||
cfg.Set(optionOwner, evt.Sender.String())
|
cfg.Set(optionOwner, evt.Sender.String())
|
||||||
b.rooms.Store(value, evt.RoomID)
|
b.rooms.Store(value, evt.RoomID)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue