This commit is contained in:
mathieui 2011-05-04 22:05:02 +02:00
parent 4968ff02d9
commit c93aafa8f5
4 changed files with 11 additions and 6 deletions

0
launch.sh Executable file → Normal file
View file

View file

@ -512,7 +512,6 @@ class MucTab(ChatTab):
Re-assign color to the participants of the room
"""
room = self.get_room()
i = 0
compare_users = lambda x: x.last_talked
users = list(room.users)
# search our own user, to remove it from the room
@ -520,10 +519,9 @@ class MucTab(ChatTab):
if user.nick == room.own_nick:
users.remove(user)
nb_color = len(theme.LIST_COLOR_NICKNAMES)
for user in sorted(users, key=compare_users, reverse=True):
for i, user in enumerate(sorted(users, key=compare_users, reverse=True)):
user.color = theme.LIST_COLOR_NICKNAMES[i % nb_color]
i += 1
self.text_win.rebuild_everything(self.get_room())
self.text_win.rebuild_everything(self._room)
self.text_win.refresh(self._room)
self.input.refresh()
@ -580,6 +578,8 @@ class MucTab(ChatTab):
if not arg.strip():
self.core.add_message_to_text_buffer(self.get_room(),
_("The subject of the room is: %s") % self.get_room().topic)
self.text_win.refresh(self.get_room())
self.input.refresh()
return
subject = arg
muc.change_subject(self.core.xmpp, self.get_room().name, subject)

View file

@ -576,7 +576,12 @@ class TextWin(Win):
while txt != '':
(txt, cutted_txt) = cut_text(txt, self.width-offset-1)
if first:
color = message.nick_color or message.user.color if message.user else None
if message.user:
color = message.user.color
elif message.nick_color:
color = message.nick_color
else:
color = None
else:
color = None
if first:

View file

@ -82,7 +82,7 @@ def convert_links_to_plaintext(text):
parent.text += link_text
parent.remove(child)
previous_child = child
return ET.tostring(xml.getroot())
return ET.tostring(xml.getroot(), encoding=str)
def clean_text(string):
"""