From 4b091ccaf8dfcfd16d4ca2b4726be44b1de1fd3b Mon Sep 17 00:00:00 2001 From: mailchuck Date: Sat, 12 Mar 2016 09:58:16 +0100 Subject: [PATCH] Sent folder in chans extended Previously, it only showed message sent to the selected chan address. Now it shows both those sent to and sent from the chan address. Fixes #181 --- src/bitmessageqt/__init__.py | 6 +++++- src/helper_search.py | 9 +++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index d03cb607..5b1abfee 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -1105,10 +1105,14 @@ class MyForm(settingsmixin.SMainWindow): # Load Sent items from database def loadSent(self, tableWidget, account, where="", what=""): - if tableWidget == self.ui.tableWidgetInboxChans or tableWidget == self.ui.tableWidgetInboxSubscriptions: + if tableWidget == self.ui.tableWidgetInboxSubscriptions: tableWidget.setColumnHidden(0, True) tableWidget.setColumnHidden(1, False) xAddress = 'toaddress' + elif tableWidget == self.ui.tableWidgetInboxChans: + tableWidget.setColumnHidden(0, False) + tableWidget.setColumnHidden(1, True) + xAddress = 'both' else: tableWidget.setColumnHidden(0, False) tableWidget.setColumnHidden(1, True) diff --git a/src/helper_search.py b/src/helper_search.py index 9ebdddbe..2217974f 100644 --- a/src/helper_search.py +++ b/src/helper_search.py @@ -41,8 +41,13 @@ def search_sql(xAddress = "toaddress", account = None, folder = "inbox", where = sqlStatementParts = [] sqlArguments = [] if account is not None: - sqlStatementParts.append(xAddress + " = ? ") - sqlArguments.append(account) + if xAddress == 'both': + sqlStatementParts.append("(fromaddress = ? OR toaddress = ?)") + sqlArguments.append(account) + sqlArguments.append(account) + else: + sqlStatementParts.append(xAddress + " = ? ") + sqlArguments.append(account) if folder is not None: if folder == "new": folder = "inbox"