Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
poezio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
203
Issues
203
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poezio
poezio
Commits
6bd012e1
Commit
6bd012e1
authored
Jul 09, 2019
by
Madhur Garg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed scroll up
parent
8e07c6d6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
poezio/mam.py
poezio/mam.py
+10
-1
poezio/tabs/basetabs.py
poezio/tabs/basetabs.py
+1
-7
No files found.
poezio/mam.py
View file @
6bd012e1
...
...
@@ -52,6 +52,8 @@ async def query(self, remote_jid, start, end, top):
for
msg
in
rsm
[
'mam'
][
'results'
]:
msgs
.
append
(
msg
)
if
msg_count
==
10
:
timestamp
=
datetime
.
now
()
add_line
(
text_buffer
,
'End of MAM query: '
,
timestamp
,
'MAM'
,
top
)
return
msg_count
+=
1
msgs
.
reverse
()
...
...
@@ -87,4 +89,11 @@ def mam_scroll(self):
start
=
start
+
timedelta
(
days
=-
10
)
start
=
datetime
.
strftime
(
start
,
'%Y-%m-%dT%H:%M:%SZ'
)
top
=
True
asyncio
.
ensure_future
(
query
(
self
,
remote_jid
,
start
,
end
,
top
))
\ No newline at end of file
pos
=
self
.
text_win
.
pos
self
.
text_win
.
pos
+=
self
.
text_win
.
height
-
1
if
self
.
text_win
.
pos
+
self
.
text_win
.
height
>
len
(
self
.
text_win
.
built_lines
):
asyncio
.
ensure_future
(
query
(
self
,
remote_jid
,
start
,
end
,
top
))
self
.
text_win
.
pos
=
len
(
self
.
text_win
.
built_lines
)
-
self
.
text_win
.
height
if
self
.
text_win
.
pos
<
0
:
self
.
text_win
.
pos
=
0
return
self
.
text_win
.
pos
!=
pos
poezio/tabs/basetabs.py
View file @
6bd012e1
...
...
@@ -959,13 +959,7 @@ class ChatTab(Tab):
return
self
.
text_win
.
scroll_down
(
1
)
def
on_scroll_up
(
self
):
self
.
text_win
.
pos
+=
self
.
text_win
.
height
-
1
pos
=
len
(
self
.
text_win
.
built_lines
)
-
self
.
text_win
.
height
-
self
.
text_win
.
pos
if
pos
<
0
:
mam
.
mam_scroll
(
self
)
self
.
text_win
.
pos
=
0
else
:
return
self
.
text_win
.
scroll_up
(
self
.
text_win
.
height
-
1
)
return
mam
.
mam_scroll
(
self
)
def
on_scroll_down
(
self
):
return
self
.
text_win
.
scroll_down
(
self
.
text_win
.
height
-
1
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment