0

I have enabled a mod_archive module to save all the chats in my ejabberd chat implementation. Now all the messages are getting saved in mysql database. But every message is getting saved twice in the archive table of ejabberd database.

I am not sure why there are 2 entries getting saved in archive table.

I think that one entry is saved at the time when server receives a message from the sender and the second entry is saved when server dispatches the messages to the recipient. Am I right?

Neeraj Yadav
  • 145
  • 1
  • 12

1 Answers1

3

There is two entries because you have the archive of the sender and the archive of the receiver. They are managed independantly because:

  1. Sender or receiver account could delete their own archive. You do not want to delete the archive of other people while doing so.
  2. ejabberd supports federation. The sender and receiver are not necessarily on the same server.
Mickaël Rémond
  • 9,035
  • 1
  • 24
  • 44
  • Thanks for the reply Mickael. Just wanted to know about the insertion time of records, when is the second record (i.e of receiver) inserted into archive table. Is it when the message is dispatched by the server to the receiver? – Neeraj Yadav Apr 13 '16 at 12:13
  • yes, when it goes to offline, it is not yet added to MAM table. – Mickaël Rémond Apr 13 '16 at 12:43