Hemant Sharma
Hemant Sharma

Reputation: 534

How to get offline messages count for a JabberID

In my application, I wanna show the total number of offline messages for each JabberId on web as well as mobile app. Hence i wanna create an API for this by which i can get the offline messages count from the Ejabberd server. This type of functionality is working on ejabberd admin panel, I wanna same on my web.

Ejabberd Admin Panel

Is there any command, script or module by which i can get the offline messages count, Please tell me.

Thanks

Upvotes: 0

Views: 670

Answers (2)

Mickaël Rémond
Mickaël Rémond

Reputation: 9055

If you have mod_admin_extra module enabled, you have a command for that: ejabberdctl get_offline_count user domain

 $ ejabberdctl help get_offline_count 

  Command Name: get_offline_count

  Arguments: user::binary
             server::binary

  Returns: res::integer

  Tags:  offline

  Description:  Get the number of unread offline messages

For example:

$ ejabberdctl get_offline_count test localhost
0

All commands can also be leverage using ReST or XMLRPC API.

Upvotes: 2

Sunil Singh
Sunil Singh

Reputation: 538

you can use mod_offline module like that mod_offline:get_queue_length(UserId,Server) for getting total number of offline message of specific user(if mod_offline module enabled).

Upvotes: 0

Related Questions