Daniel Brötzmann pushed to branch master at gajim / gajim

Commits:

2 changed files:

Changes:

  • gajim/gtk/controls/base.py
    ... ... @@ -225,6 +225,9 @@ def __init__(self, widget_name: str, account: str, jid: JID) -> None:
    225 225
     
    
    226 226
             self.xml.hbox.pack_start(self.msg_scrolledwindow, True, True, 0)
    
    227 227
     
    
    228
    +        # Used for initial message row fetching in ConversationView
    
    229
    +        self._initial_fetch_finished: bool = False
    
    230
    +
    
    228 231
             # the following vars are used to keep history of user's messages
    
    229 232
             self.sent_history: List[str] = []
    
    230 233
             self.sent_history_pos: int = 0
    
    ... ... @@ -1312,6 +1315,10 @@ def update_text_tags(self):
    1312 1315
             self.conversation_view.update_text_tags()
    
    1313 1316
     
    
    1314 1317
         def set_control_active(self, state: bool) -> None:
    
    1318
    +        if not self._initial_fetch_finished:
    
    1319
    +            self.fetch_n_lines_history(self._scrolled_view, True, 20)
    
    1320
    +            self._initial_fetch_finished = True
    
    1321
    +
    
    1315 1322
             if state:
    
    1316 1323
                 self.set_emoticon_popover()
    
    1317 1324
     
    

  • gajim/gtk/conversation/scrolled.py
    ... ... @@ -111,12 +111,10 @@ def _on_adj_upper_changed(self,
    111 111
                     if self._requesting == 'before':
    
    112 112
                         adj.set_value(adj.get_value() + diff)
    
    113 113
     
    
    114
    -        if upper == adj.get_page_size():
    
    115
    -            # There is no scrollbar, request history until there is
    
    116
    -            self.emit('request-history', True)
    
    117
    -            self._lower_complete = True
    
    118
    -            self._autoscroll = True
    
    119
    -            self.emit('autoscroll-changed', self._autoscroll)
    
    114
    +        self._lower_complete = True
    
    115
    +        self._autoscroll = True
    
    116
    +        self.emit('autoscroll-changed', self._autoscroll)
    
    117
    +
    
    120 118
             self._requesting = None
    
    121 119
     
    
    122 120
         def _on_adj_value_changed(self,