From a4c48228fc3038be57084fec8ae8f1c69abc1bfd Mon Sep 17 00:00:00 2001 From: mailchuck Date: Sat, 23 Jan 2016 10:14:12 +0100 Subject: [PATCH] Messagelist subscription color Fixes Bitmessage#842 --- src/bitmessageqt/__init__.py | 2 +- src/bitmessageqt/account.py | 1 + src/bitmessageqt/foldertree.py | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 7770b98f..fa099954 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -1040,7 +1040,7 @@ class MyForm(settingsmixin.SMainWindow): def addMessageListItemInbox(self, tableWidget, msgfolder, msgid, toAddress, fromAddress, subject, received, read): font = QFont() font.setBold(True) - if tableWidget == self.ui.tableWidgetInboxSubscriptions: + if toAddress == str_broadcast_subscribers: acct = accountClass(fromAddress) else: acct = accountClass(toAddress) diff --git a/src/bitmessageqt/account.py b/src/bitmessageqt/account.py index dc21d669..d1afd560 100644 --- a/src/bitmessageqt/account.py +++ b/src/bitmessageqt/account.py @@ -40,6 +40,7 @@ def getSortedSubscriptions(count = False): def accountClass(address): if not shared.config.has_section(address): + # FIXME: This BROADCAST section makes no sense if address == str_broadcast_subscribers: subscription = BroadcastAccount(address) if subscription.type != AccountMixin.BROADCAST: diff --git a/src/bitmessageqt/foldertree.py b/src/bitmessageqt/foldertree.py index 19d5dc12..a9369a48 100644 --- a/src/bitmessageqt/foldertree.py +++ b/src/bitmessageqt/foldertree.py @@ -69,6 +69,9 @@ class AccountMixin (object): self.type = self.CHAN elif shared.safeConfigGetBoolean(self.address, 'mailinglist'): self.type = self.MAILINGLIST + elif sqlQuery( + '''select label from subscriptions where address=?''', self.address): + self.type = AccountMixin.SUBSCRIPTION else: self.type = self.NORMAL