load Sent To label from subscriptions if available

This commit is contained in:
Jonathan Warren 2013-11-02 17:34:46 -04:00
parent a4b5ded803
commit 162114ab28

View File

@ -706,6 +706,15 @@ class MyForm(QtGui.QMainWindow):
if queryreturn != []: if queryreturn != []:
for row in queryreturn: for row in queryreturn:
toLabel, = row toLabel, = row
if toLabel == '':
# It might be a broadcast message. We should check for that
# label.
queryreturn = sqlQuery(
'''select label from subscriptions where address=?''', toAddress)
if queryreturn != []:
for row in queryreturn:
toLabel, = row
if toLabel == '': if toLabel == '':
if shared.config.has_section(toAddress): if shared.config.has_section(toAddress):
@ -831,7 +840,7 @@ class MyForm(QtGui.QMainWindow):
if shared.config.has_section(fromAddress): if shared.config.has_section(fromAddress):
fromLabel = shared.config.get(fromAddress, 'label') fromLabel = shared.config.get(fromAddress, 'label')
if fromLabel == '': # If the fromAddress isn't one of our addresses if fromLabel == '': # If the fromAddress isn't one of our addresses and isn't a chan
queryreturn = sqlQuery( queryreturn = sqlQuery(
'''select label from addressbook where address=?''', fromAddress) '''select label from addressbook where address=?''', fromAddress)
if queryreturn != []: if queryreturn != []:
@ -839,7 +848,7 @@ class MyForm(QtGui.QMainWindow):
fromLabel, = row fromLabel, = row
if fromLabel == '': # If this address wasn't in our address book... if fromLabel == '': # If this address wasn't in our address book...
queryReturn = sqlQuery( queryreturn = sqlQuery(
'''select label from subscriptions where address=?''', fromAddress) '''select label from subscriptions where address=?''', fromAddress)
if queryreturn != []: if queryreturn != []:
for row in queryreturn: for row in queryreturn: