Email gateway autoregistration fixes

- don't treat "@" in label as an email address
- ask for confirmation before autoregistering. It confused some
newbies into thinking that bitmessage requires payment
This commit is contained in:
Peter Šurda 2017-08-24 14:16:37 +02:00
parent 660997b8f4
commit 7e35ea6bdf
Signed by untrusted user: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -1968,12 +1968,16 @@ class MyForm(settingsmixin.SMainWindow):
if "<" in toAddress and ">" in toAddress: if "<" in toAddress and ">" in toAddress:
toAddress = toAddress.split('<')[1].split('>')[0] toAddress = toAddress.split('<')[1].split('>')[0]
# email address # email address
elif toAddress.find("@") >= 0: if toAddress.find("@") >= 0:
if isinstance(acct, GatewayAccount): if isinstance(acct, GatewayAccount):
acct.createMessage(toAddress, fromAddress, subject, message) acct.createMessage(toAddress, fromAddress, subject, message)
subject = acct.subject subject = acct.subject
toAddress = acct.toAddress toAddress = acct.toAddress
else: else:
if QtGui.QMessageBox.question(self, "Sending an email?", _translate("MainWindow",
"You are trying to send an email instead of a bitmessage. This requires registering with a gateway. Attempt to register?"),
QtGui.QMessageBox.Yes|QtGui.QMessageBox.No) != QtGui.QMessageBox.Yes:
continue
email = acct.getLabel() email = acct.getLabel()
if email[-14:] != "@mailchuck.com": #attempt register if email[-14:] != "@mailchuck.com": #attempt register
# 12 character random email address # 12 character random email address