From ee3594db46fe261962f0a8a11c48cb9d6f84938f Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sat, 25 Jul 2020 20:54:32 +0300 Subject: Add toggle to only send to verified devices --- ui/verification-modal.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'ui/verification-modal.go') diff --git a/ui/verification-modal.go b/ui/verification-modal.go index e47006e..54c2ecf 100644 --- a/ui/verification-modal.go +++ b/ui/verification-modal.go @@ -96,7 +96,9 @@ func NewVerificationModal(mainView *MainView, device *crypto.DeviceIdentity, tim vm.emojiText = &EmojiView{} - vm.inputBar = mauview.NewInputField().SetBackgroundColor(tcell.ColorDefault) + vm.inputBar = mauview.NewInputField(). + SetBackgroundColor(tcell.ColorDefault). + SetPlaceholderTextColor(tcell.ColorWhite) flex := mauview.NewFlex(). SetDirection(mauview.FlexRow). @@ -176,7 +178,7 @@ func (vm *VerificationModal) OnCancel(cancelledByUs bool, reason string, _ event } else { vm.infoText.SetText(fmt.Sprintf("Verification cancelled by %s: %s", vm.device.UserID, reason)) } - vm.inputBar.SetPlaceholder("Press enter to close dialog") + vm.inputBar.SetPlaceholder("Press enter to close the dialog") vm.done = true vm.parent.parent.Render() } @@ -185,9 +187,13 @@ func (vm *VerificationModal) OnSuccess() { vm.waitingBar.SetIndeterminate(false).SetMax(100).SetProgress(100) vm.parent.parent.app.SetRedrawTicker(1 * time.Minute) vm.infoText.SetText(fmt.Sprintf("Successfully verified %s (%s) of %s", vm.device.Name, vm.device.DeviceID, vm.device.UserID)) - vm.inputBar.SetPlaceholder("Press enter to close dialog") + vm.inputBar.SetPlaceholder("Press enter to close the dialog") vm.done = true vm.parent.parent.Render() + if vm.parent.config.SendToVerifiedOnly { + // Hacky way to make new group sessions after verified + vm.parent.matrix.Crypto().(*crypto.OlmMachine).OnDevicesChanged(vm.device.UserID) + } } func (vm *VerificationModal) OnKeyEvent(event mauview.KeyEvent) bool { -- cgit v1.2.3