Context menu on messages to deleted accounts
- messages from deleted chans still stay in global inbox - this crated problems with account detection - created NoAccount class for such accounts
This commit is contained in:
parent
72ed3e340f
commit
57a3c35299
|
@ -54,7 +54,8 @@ def accountClass(address):
|
||||||
else:
|
else:
|
||||||
subscription = SubscriptionAccount(address)
|
subscription = SubscriptionAccount(address)
|
||||||
if subscription.type != AccountMixin.SUBSCRIPTION:
|
if subscription.type != AccountMixin.SUBSCRIPTION:
|
||||||
return None
|
# e.g. deleted chan
|
||||||
|
return NoAccount(address)
|
||||||
return subscription
|
return subscription
|
||||||
try:
|
try:
|
||||||
gateway = BMConfigParser().get(address, "gateway")
|
gateway = BMConfigParser().get(address, "gateway")
|
||||||
|
@ -137,6 +138,17 @@ class BMAccount(object):
|
||||||
self.toLabel = self.getLabel(toAddress)
|
self.toLabel = self.getLabel(toAddress)
|
||||||
|
|
||||||
|
|
||||||
|
class NoAccount(BMAccount):
|
||||||
|
def __init__(self, address = None):
|
||||||
|
self.address = address
|
||||||
|
self.type = AccountMixin.NORMAL
|
||||||
|
|
||||||
|
def getLabel(self, address = None):
|
||||||
|
if address is None:
|
||||||
|
address = self.address
|
||||||
|
return address
|
||||||
|
|
||||||
|
|
||||||
class SubscriptionAccount(BMAccount):
|
class SubscriptionAccount(BMAccount):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user