diff --git a/frontends/src/primitivus/chat.py b/frontends/src/primitivus/chat.py index fb794a9e..7ffaeb50 100644 --- a/frontends/src/primitivus/chat.py +++ b/frontends/src/primitivus/chat.py @@ -229,7 +229,10 @@ class Chat(urwid.WidgetWrap, QuickChat): return my_jid = self.host.profiles[profile]['whoami'] self.content.append(ChatText(self, timestamp or None, nick, mymess, msg)) - self.text_list.set_focus(len(self.content)-1) + if self.text_list.get_focus()[1] == len(self.content)-2: + #we don't change focus if user is not at the bottom + #as that mean that he is probably watching discussion history + self.text_list.set_focus(len(self.content)-1) self.host.redraw() if not self.host.notify.hasFocus(): if self.type=="one2one": @@ -245,7 +248,10 @@ class Chat(urwid.WidgetWrap, QuickChat): me: "/me" information like "/me clenches his fist" ==> "toto clenches his fist" """ self.content.append(sat_widgets.ClickableText(msg)) - self.text_list.set_focus(len(self.content)-1) + if self.text_list.get_focus()[1] == len(self.content)-2: + #we don't change focus if user is not at the bottom + #as that mean that he is probably watching discussion history + self.text_list.set_focus(len(self.content)-1) self.host.redraw() if not self.host.notify.hasFocus(): if self.type=="one2one":