mirror of https://github.com/sipwise/prosody.git
This was duplicating the results of the query when retrieving
the archive info
Change-Id: If2ce9baf3af562ae02c2c9cbb847b740faffb543
(cherry picked from commit 34e3345f53)
mr7.5.7
parent
36568b12b5
commit
077720dbb0
@ -1,40 +0,0 @@
|
||||
From: Sipwise Development Team <support@sipwise.com>
|
||||
Date: Wed, 11 Dec 2019 11:15:14 +0100
|
||||
Subject: TT-35053-mod_mam-sipwise_archive.lib-fix-retrieving-incoming
|
||||
|
||||
---
|
||||
plugins/mod_mam/sipwise_archive.lib.lua | 7 ++++---
|
||||
1 file changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/plugins/mod_mam/sipwise_archive.lib.lua b/plugins/mod_mam/sipwise_archive.lib.lua
|
||||
index 15acb33..533df4f 100644
|
||||
--- a/plugins/mod_mam/sipwise_archive.lib.lua
|
||||
+++ b/plugins/mod_mam/sipwise_archive.lib.lua
|
||||
@@ -36,7 +36,7 @@ WHERE `key` = UuidToBin(?);
|
||||
|
||||
local select_query_base=[[
|
||||
SELECT UuidFromBin(`key`),`stanza`,`epoch`,`with` FROM `sipwise_mam`
|
||||
-WHERE `username` = ?
|
||||
+WHERE (`username` = ? or `with` = ?)
|
||||
]]
|
||||
|
||||
-- Reconnect to DB if necessary
|
||||
@@ -100,7 +100,7 @@ function archive_store:find(username, query)
|
||||
local qstart, qend, qwith = -math.huge, math.huge;
|
||||
local qlimit, qid;
|
||||
local db_query = select_query_base;
|
||||
- local _params = { username..'@'..host, };
|
||||
+ local _params = { username..'@'..host, username..'@'..host, };
|
||||
local i, values = 0;
|
||||
|
||||
if query then
|
||||
@@ -118,7 +118,8 @@ function archive_store:find(username, query)
|
||||
end
|
||||
|
||||
if qwith then
|
||||
- db_query = db_query.." AND `with` = ?";
|
||||
+ db_query = db_query.." AND (`username` = ? OR `with` = ?)";
|
||||
+ table.insert(_params, qwith);
|
||||
table.insert(_params, qwith);
|
||||
end
|
||||
if qid then
|
||||
Loading…
Reference in new issue