summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2011-05-04 22:05:02 +0200
committermathieui <mathieui@mathieui.net>2011-05-04 22:05:02 +0200
commitc93aafa8f5b1e75a9bdfed7edf47ac4a25fcad86 (patch)
treecde227eb54179e800daf73425fa71402d11031e5 /src
parent4968ff02d97a4d3afeb602860aa46b727bd6509b (diff)
downloadpoezio-c93aafa8f5b1e75a9bdfed7edf47ac4a25fcad86.tar.gz
poezio-c93aafa8f5b1e75a9bdfed7edf47ac4a25fcad86.tar.bz2
poezio-c93aafa8f5b1e75a9bdfed7edf47ac4a25fcad86.tar.xz
poezio-c93aafa8f5b1e75a9bdfed7edf47ac4a25fcad86.zip
fixes #2148, #2156, #2155
Diffstat (limited to 'src')
-rw-r--r--src/tabs.py8
-rw-r--r--src/windows.py7
-rw-r--r--src/xhtml.py2
3 files changed, 11 insertions, 6 deletions
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):
"""