Skip to content

Commit 9193c20

Browse files
mailchuckPeterSurda
authored andcommitted
Labels when replying
If present, a label will be included in the reply line edit.
1 parent fabfc91 commit 9193c20

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/bitmessageqt/__init__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2925,13 +2925,19 @@ def on_action_InboxReply(self, replyType = None):
29252925
}
29262926
self.ui.tabWidgetSend.setCurrentIndex(1)
29272927
toAddressAtCurrentInboxRow = fromAddressAtCurrentInboxRow
2928-
2929-
self.ui.lineEditTo.setText(str(acct.fromAddress))
2928+
if fromAddressAtCurrentInboxRow == tableWidget.item(currentInboxRow, 1).label or (
2929+
isinstance(acct, GatewayAccount) and fromAddressAtCurrentInboxRow == acct.relayAddress):
2930+
self.ui.lineEditTo.setText(str(acct.fromAddress))
2931+
else:
2932+
self.ui.lineEditTo.setText(tableWidget.item(currentInboxRow, 1).label + " <" + str(acct.fromAddress) + ">")
29302933

29312934
# 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.
29322935
if acct.type == AccountMixin.CHAN and replyType == self.REPLY_TYPE_CHAN:
29332936
logger.debug('original sent to a chan. Setting the to address in the reply to the chan address.')
2934-
self.ui.lineEditTo.setText(str(toAddressAtCurrentInboxRow))
2937+
if toAddressAtCurrentInboxRow == tableWidget.item(currentInboxRow, 0).label:
2938+
self.ui.lineEditTo.setText(str(toAddressAtCurrentInboxRow))
2939+
else:
2940+
self.ui.lineEditTo.setText(tableWidget.item(currentInboxRow, 0).label + " <" + str(acct.toAddress) + ">")
29352941

29362942
self.setSendFromComboBox(toAddressAtCurrentInboxRow)
29372943

0 commit comments

Comments
 (0)