Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sophie Herold
gajim
Commits
c45d0f5b
Commit
c45d0f5b
authored
7 years ago
by
Philipp Hörist
Browse files
Options
Downloads
Patches
Plain Diff
Query MUC archives with the correct namespace
parent
3683f238
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gajim/common/caps_cache.py
+9
-0
9 additions, 0 deletions
gajim/common/caps_cache.py
gajim/common/message_archiving.py
+7
-1
7 additions, 1 deletion
gajim/common/message_archiving.py
with
16 additions
and
1 deletion
gajim/common/caps_cache.py
+
9
−
0
View file @
c45d0f5b
...
...
@@ -491,3 +491,12 @@ class MucCapsCache:
return
True
except
(
KeyError
,
AttributeError
):
return
False
def
get_mam_namespace
(
self
,
jid
):
try
:
if
nbxmpp
.
NS_MAM_2
in
self
.
cache
[
jid
].
features
:
return
nbxmpp
.
NS_MAM_2
elif
nbxmpp
.
NS_MAM_1
in
self
.
cache
[
jid
].
features
:
return
nbxmpp
.
NS_MAM_1
except
(
KeyError
,
AttributeError
):
return
This diff is collapsed.
Click to expand it.
gajim/common/message_archiving.py
+
7
−
1
View file @
c45d0f5b
...
...
@@ -27,6 +27,7 @@ from gajim.common import app
from
gajim.common
import
ged
from
gajim.common.logger
import
KindConstant
,
JIDConstant
from
gajim.common.const
import
ArchiveState
from
gajim.common.caps_cache
import
muc_caps_cache
import
gajim.common.connection_handlers_events
as
ev
log
=
logging
.
getLogger
(
'
gajim.c.message_archiving
'
)
...
...
@@ -296,7 +297,12 @@ class ConnectionArchive313:
def
get_archive_query
(
self
,
query_id
,
jid
=
None
,
start
=
None
,
end
=
None
,
with_
=
None
,
after
=
None
,
max_
=
30
):
namespace
=
self
.
archiving_namespace
# Muc archive query?
namespace
=
muc_caps_cache
.
get_mam_namespace
(
jid
)
if
namespace
is
None
:
# Query to our own archive
namespace
=
self
.
archiving_namespace
iq
=
nbxmpp
.
Iq
(
'
set
'
,
to
=
jid
)
query
=
iq
.
addChild
(
'
query
'
,
namespace
=
namespace
)
form
=
query
.
addChild
(
node
=
nbxmpp
.
DataForm
(
typ
=
'
submit
'
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment