Re: [prosody-dev] how to query store messages count?

127 views
Skip to first unread message

Kim Alvefur

unread,
Apr 11, 2013, 3:53:44 PM4/11/13
to proso...@googlegroups.com
On 2013-04-11 09:13, 侯仰望幸福 wrote:
> the count is not all messages count.

It was incorrectly reporting the number of messages sent during the query.

> how i get the all item counts?

I have pushed a fix, updating should make it work. It now reports the
total number of messages in the archive, before applying any of the
filters described in XEP-0313.

But please note that mod_mam is not meant for use in production, it
lacks an efficient storage method and mostly meant to allow client
developers to test the protocol against something useful. You may want
to look at mod_mam_sql, but it does currently not support some things
mod_mam does, including reporting the total number of messages.

--
Kim "Zash" Alvefur

signature.asc

侯仰望幸福

unread,
Apr 19, 2013, 4:21:58 AM4/19/13
to proso...@googlegroups.com, za...@zash.se
thanks,  i use mod_mam_sql , bug it's not work. i found errors in logs:

Apr 19 16:01:19 modulemanager   error   Error initializing module 'mam_sql' on '192.168.1.115': /usr/lib/prosody/modules/mod_mam_sql.lua:36: attempt to call method 'shared'
 18 stack traceback:
 19     /usr/lib/prosody/core/modulemanager.lua:35: in function 'shared'
 20     /usr/lib/prosody/modules/mod_mam_sql.lua:36: in main chunk
 21     (tail call): ?
 22     [C]: in function 'xpcall'
 23     /usr/lib/prosody/core/modulemanager.lua:35: in function 'pcall'
 24     /usr/lib/prosody/core/modulemanager.lua:129: in function 'load'
 25     /usr/lib/prosody/core/modulemanager.lua:88: in function '?'
 26     /usr/lib/prosody/util/events.lua:67: in function 'fire_event'
 27     /usr/lib/prosody/core/hostmanager.lua:84: in function 'activate'
 28     /usr/lib/prosody/core/hostmanager.lua:42: in function '?'
 29     /usr/lib/prosody/util/events.lua:67: in function 'fire_event'
 30     /usr/bin/prosody:374: in function 'prepare_to_start'
 31     /usr/bin/prosody:490: in main chunk
 32     [C]: ?
~

my prosody version is 0.8.2

侯仰望幸福

unread,
Apr 19, 2013, 4:26:59 AM4/19/13
to proso...@googlegroups.com, za...@zash.se


在 2013年4月19日星期五UTC+8下午4时21分58秒,侯仰望幸福写道:
my prosody version is 0.8.2,
   this is my configure:

  mam_sql = {
        sql = {
                driver = "SQLite3";
                database = "/home/hzm/prosody.db";
         
                }
        }

Kim Alvefur

unread,
Apr 19, 2013, 8:22:45 AM4/19/13
to 侯仰望幸福, proso...@googlegroups.com
On 2013-04-19 10:21, 侯仰望幸福 wrote:
> thanks, i use mod_mam_sql , bug it's not work. i found errors in logs:
>
> Apr 19 16:01:19 modulemanager error Error initializing module 'mam_sql'
> on '192.168.1.115': /usr/lib/prosody/modules/mod_mam_sql.lua:36: attempt to
> call method 'shared'
> 18 stack traceback:
> (...)
> my prosody version is 0.8.2

Right, there's no mod_mam_sql for 0.8 at the moment. I will push the
0.8 version to the 0.8 repo in a moment. See 0.8x compatibility on
http://code.google.com/p/prosody-modules/

--
Kim


signature.asc

侯仰望幸福

unread,
Apr 21, 2013, 10:07:40 PM4/21/13
to proso...@googlegroups.com, 侯仰望幸福, za...@zash.se
ok, thanks .can you add first stanza and  total number of messages ?
i need to query total number of messages.

在 2013年4月19日星期五UTC+8下午8时22分45秒,Kim Alvefur写道:
Reply all
Reply to author
Forward
0 new messages