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
205
Issues
205
List
Boards
Labels
Service Desk
Milestones
Merge Requests
10
Merge Requests
10
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
aae00af2
Commit
aae00af2
authored
Aug 21, 2019
by
Madhur Garg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed query_id from int to boolean type.
parent
47dc7f00
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
poezio/mam.py
poezio/mam.py
+4
-4
poezio/tabs/basetabs.py
poezio/tabs/basetabs.py
+4
-4
No files found.
poezio/mam.py
View file @
aae00af2
...
...
@@ -67,7 +67,7 @@ async def query(tab, remote_jid, top, start=None, end=None, before=None):
try
:
iq
=
await
tab
.
core
.
xmpp
.
plugin
[
'xep_0030'
].
get_info
(
jid
=
remote_jid
)
except
(
IqError
,
IqTimeout
):
return
tab
.
information
(
'Failed to retrieve messages'
,
'Error'
)
return
tab
.
core
.
information
(
'Failed to retrieve messages'
,
'Error'
)
if
'urn:xmpp:mam:2'
not
in
iq
[
'disco_info'
].
get_features
():
return
tab
.
core
.
information
(
"%s doesn't support MAM."
%
remote_jid
,
"Info"
)
if
top
:
...
...
@@ -113,7 +113,7 @@ async def query(tab, remote_jid, top, start=None, end=None, before=None):
'{%s}%s'
%
(
'jabber:client'
,
'body'
))
is
not
None
:
msgs
.
append
(
msg
)
if
msg_count
==
10
:
tab
.
query_
id
=
0
tab
.
query_
status
=
False
tab
.
core
.
refresh_window
()
return
msg_count
+=
1
...
...
@@ -136,7 +136,7 @@ async def query(tab, remote_jid, top, start=None, end=None, before=None):
tab
.
core
.
refresh_window
()
if
len
(
msgs
)
==
0
:
return
tab
.
core
.
information
(
'No more messages left to retrieve'
,
'Info'
)
tab
.
query_
id
=
0
tab
.
query_
status
=
False
def
mam_scroll
(
tab
):
remote_jid
=
tab
.
jid
...
...
@@ -160,7 +160,7 @@ def mam_scroll(tab):
asyncio
.
ensure_future
(
query
(
tab
,
remote_jid
,
top
=
True
,
end
=
end
))
else
:
asyncio
.
ensure_future
(
query
(
tab
,
remote_jid
,
top
=
True
,
before
=
before
))
tab
.
query_
id
=
1
tab
.
query_
status
=
True
tab
.
text_win
.
pos
=
len
(
tab
.
text_win
.
built_lines
)
-
tab
.
text_win
.
height
if
tab
.
text_win
.
pos
<
0
:
tab
.
text_win
.
pos
=
0
...
...
poezio/tabs/basetabs.py
View file @
aae00af2
...
...
@@ -474,7 +474,7 @@ class ChatTab(Tab):
jid
=
JID
(
jid
)
assert
jid
.
domain
self
.
_jid
=
jid
self
.
query_
id
=
0
self
.
query_
status
=
False
self
.
last_stanza_id
=
None
self
.
_name
=
jid
.
full
# type: Optional[str]
...
...
@@ -928,10 +928,10 @@ class ChatTab(Tab):
return
self
.
text_win
.
scroll_down
(
1
)
def
on_scroll_up
(
self
):
if
self
.
query_id
==
0
:
return
mam
.
mam_scroll
(
tab
=
self
)
else
:
if
self
.
query_status
:
return
self
.
text_win
.
scroll_up
(
self
.
text_win
.
height
-
1
)
else
:
return
mam
.
mam_scroll
(
tab
=
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