diff --git a/launch.sh b/launch.sh old mode 100755 new mode 100644 diff --git a/src/tabs.py b/src/tabs.py index 36688a8c..a1944b9c 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -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) diff --git a/src/windows.py b/src/windows.py index f10c0853..53cd0781 100644 --- a/src/windows.py +++ b/src/windows.py @@ -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: diff --git a/src/xhtml.py b/src/xhtml.py index f0c55978..fee5a118 100644 --- a/src/xhtml.py +++ b/src/xhtml.py @@ -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): """