set the Thread.title attribute

This commit is contained in:
Romain Bignon 2010-10-04 21:15:56 +02:00
commit 3ff5b31f4a

View file

@ -97,6 +97,7 @@ class AuMBackend(BaseBackend, ICapMessages, ICapMessagesPost, ICapDating, ICapCh
if not contact.get_id(): if not contact.get_id():
continue continue
thread = Thread(contact.get_id()) thread = Thread(contact.get_id())
thread.title = 'Discussion with %s' % contact.get_name()
yield thread yield thread
def get_thread(self, id, profiles=None): def get_thread(self, id, profiles=None):
@ -141,6 +142,9 @@ class AuMBackend(BaseBackend, ICapMessages, ICapMessagesPost, ICapDating, ICapCh
else: else:
flags |= Message.IS_ACCUSED flags |= Message.IS_ACCUSED
if not thread.title:
thread.title = mail.title
msg = Message(thread=thread, msg = Message(thread=thread,
id=mail.message_id, id=mail.message_id,
title=mail.title, title=mail.title,
@ -192,9 +196,10 @@ class AuMBackend(BaseBackend, ICapMessages, ICapMessagesPost, ICapDating, ICapCh
profile = self.browser.get_profile(ids[new_baskets]) profile = self.browser.get_profile(ids[new_baskets])
thread = Thread(profile.get_id()) thread = Thread(profile.get_id())
thread.title = 'Basket of %s' % profile.get_name()
thread.root = Message(thread=thread, thread.root = Message(thread=thread,
id=self.MAGIC_ID_BASKET, id=self.MAGIC_ID_BASKET,
title='Basket of %s' % profile.get_name(), title=thread.title,
sender=profile.get_name(), sender=profile.get_name(),
receiver=self.browser.get_my_name(), receiver=self.browser.get_my_name(),
date=None, # now date=None, # now