From 9193c2070ea20facef8dd13ac5230147e3d01823 Mon Sep 17 00:00:00 2001 From: mailchuck Date: Sat, 30 Apr 2016 10:37:34 +0200 Subject: [PATCH] Labels when replying If present, a label will be included in the reply line edit. --- src/bitmessageqt/__init__.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index a314a978..0cd07c13 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -2925,13 +2925,19 @@ class MyForm(settingsmixin.SMainWindow): } self.ui.tabWidgetSend.setCurrentIndex(1) toAddressAtCurrentInboxRow = fromAddressAtCurrentInboxRow - - self.ui.lineEditTo.setText(str(acct.fromAddress)) + if fromAddressAtCurrentInboxRow == tableWidget.item(currentInboxRow, 1).label or ( + isinstance(acct, GatewayAccount) and fromAddressAtCurrentInboxRow == acct.relayAddress): + self.ui.lineEditTo.setText(str(acct.fromAddress)) + else: + self.ui.lineEditTo.setText(tableWidget.item(currentInboxRow, 1).label + " <" + str(acct.fromAddress) + ">") # If the previous message was to a chan then we should send our reply to the chan rather than to the particular person who sent the message. if acct.type == AccountMixin.CHAN and replyType == self.REPLY_TYPE_CHAN: logger.debug('original sent to a chan. Setting the to address in the reply to the chan address.') - self.ui.lineEditTo.setText(str(toAddressAtCurrentInboxRow)) + if toAddressAtCurrentInboxRow == tableWidget.item(currentInboxRow, 0).label: + self.ui.lineEditTo.setText(str(toAddressAtCurrentInboxRow)) + else: + self.ui.lineEditTo.setText(tableWidget.item(currentInboxRow, 0).label + " <" + str(acct.toAddress) + ">") self.setSendFromComboBox(toAddressAtCurrentInboxRow)