#577 Offline message to database

Reporter Thomas Camaran
Owner Zash
Created
Updated
Stars ★★ (2)  
Tags
  • Milestone-0.10
  • Type-Enhancement
  • Status-Fixed
  • Priority-Medium
  1. Thomas Camaran on

    Add option to store offline message to MySQL or other DB

  2. MattJ on

    Hi Thomas, thanks for filing this featue request! I'd be interested to know more about how you would use this feature. Ultimately: why do you want it? Thanks!

    Changes
    • owner MattJ
  3. Thomas on

    Hi, for example i can use with two server for delivery the offline message or if one server is down i can start an other without lost

  4. Praveen on

    Say when you are using it for an in-app chat application and the user has not opened the app. We could use the data in the table to notify the user that he has messages to be viewed. Lets say a GCM or an APNS notification.

  5. Thomas on

    And also all modlus use sql storage, i think also this must be for standard

  6. MattJ on

    Praveen: the correct way to implement that would be through a Prosody module that hooks the "message/offline/handle" event. See mod_offline_email in prosody-modules for an example of this (which "pushes" offline messages over email). Polling the database would be inefficient. Thomas: For the multiple server use-case: this isn't really reliable until Prosody implements clustering, and when it does, I doubt it will depend on SQL. In general: I'm not 100% sure that every kind of data is suitable for storage in an SQL database. Yes, it *can* be done, but that doesn't make it a good idea... :) That said, we are planning to move offline messages to our archive storage API (the same one used by MAM), and since mod_storage_sql supports that, you'll be able to store offline messages there if you want.

    Changes
    • tags Status-Accepted
  7. Zash on

    With https://hg.prosody.im/0.10/rev/8eec715c13a6 it should now be possible to get archives into SQL, or wherever. Note that upgrading may leave unreachable messages in the old list files. These can be migrated using mod_migrate from prosody-modules.

    Changes
    • tags Milestone-0.10 Status-Fixed
    • owner MattJ Zash

New comment