robbiehanson / XMPPFramework

An XMPP Framework in Objective-C for Mac and iOS
Other
5.91k stars 2.09k forks source link

MUC Light Offline message fetch needed #821

Closed vickydhas closed 7 years ago

vickydhas commented 7 years ago

Hello Robbie & Team,

Thanks for quickly bringing this XMPP MUC Light , its a great help to fix the Traditional MUC limitation and work like whatsapp groups.

Appreciate your work done. I have implemented the MUC Light on my MongooseIM server and also the same on IOS using your framework. Docs guidelines.

The issue I am facing now is Push notification (handled seperately) and Offline message fetch. Understand this is not going to be like mod_offline push from server for offline messages, we need to use Mod MUC Archive.

Can you help me to understand as example how to use this to get the offline message for MUC light as I see they are now in my mam_muc_message table in my database. Note that I am not interested in the MAM for single chat as that is already take care by mod_offline.

Appreciate your help given on this.

chrisballinger commented 7 years ago

You'll need to implement XEP-0357 for push. There are category methods in XMPPFramework to help with the registration process, but the actual implementation will be specific to your app.

On Thu, Nov 3, 2016 at 11:49 PM, Vicky Dhas notifications@github.com wrote:

Hello Robbie & Team,

Thanks for quickly bringing this XMPP MUC Light , its a great help to fix the Traditional MUC limitation and work like whatsapp groups.

Appreciate your work done. I have implemented the MUC Light on my MongooseIM server and also the same on IOS using your framework. Docs guidelines https://github.com/robbiehanson/XMPPFramework/issues/745.

The issue I am facing now is Push notification (handled seperately) and Offline message fetch. Understand this is not going to be like mod_offline push from server for offline messages, we need to use Mod MUC Archive.

Can you help me to understand as example how to use this to get the offline message for MUC light as I see they are now in my _mam_mucmessage table in my database. Note that I am not interested in the MAM for single chat as that is already take care by mod_offline.

Appreciate your help given on this.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/robbiehanson/XMPPFramework/issues/821, or mute the thread https://github.com/notifications/unsubscribe-auth/AAfqH63eJT1rm1xdQr35He3SVQHrRmQ4ks5q6tWEgaJpZM4KpPTf .

vickydhas commented 7 years ago

Well registration I am handling using http module provided my mongooseim in beta 2.0.0 however for the push I am using mod_zeropush at this moment for single chat.

My query is bit different. 1) how to handle if there is any example code snippet for muc light offline message fetch from mam_myc_message table stored in MySQL. 2) push notification handling in zero push for all muc messages.

As I see mam because mod offline module is for single chat but doesn't pushes message to client on online back again. But client have to request muc messages and it's only possible using mod archive, so bit confused how to handle in framework the mod archive to get messages only saved in server for muc only.

vickydhas commented 7 years ago

Any update how this can be achieved.

As I am able to fetch the MUC Light message from MySQL using Mod MAM process explained in '6.2.1 Groupchat message from occupant'.

But this is not pagination enabled like traditional MAM to fetch few stanzas or chats. This always returns me from 0th element so will be heavy on client side.

any inputs.

vickydhas commented 7 years ago

Closing this issue as I managed to use the Mod Archive MAM methods to pull the messages.

However this leads me to not have functionality like when user declares online to server the MIM servers pushes the offline messages to user for the group chat.

Single chat offline pushing is working fine, hope there is a future update with this feature as well.

bilalrotan commented 6 years ago

hi @vickydhas can you please help me to fetch archived messages MUC Light

I am sending following stanza

<iq type="set" id="1843C080-79A8-4F05-90AA-DAA67F7FCF00">
    <query xmlns="urn:xmpp:mam:2" queryid="6B9D9726-C7DB-4B37-ADC7-06D2B4ABC77B">
        <x xmlns="jabber:x:data" type="submit">
            <field var="FORM_TYPE" type="hidden">
                <value>urn:xmpp:mam:2</value>
            </field>
            <field var="start">
                <value>2018-07-12T08:57:07Z</value>
            </field>
        </x>
    </query>
</iq>

But error coming in response

#<iq xmlns="jabber:client" from="971555377129@localhost" to="971555377129@localhost/60CD75D6-48F8-4D94-898E-5CF0305FA7B9" 
id="2E7185E3-24F6-4D2C-B1AB-4B119FF209A4" type="error">
    <error code="500" type="wait">
        <internal-server-error xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">
        </internal-server-error>
    </error>
</iq>

can you please guide me what I am doing wrong .. Thank you

antivista commented 4 years ago

As DenysGonchar accurately explained me here #2879, it is possible to enable store_groupchat_messages option for mod_offline in end to store offline messages for chat groups.

But this approach is discouraged because in this way messages are sent immediately without any way to control it from the client device, affecting connection time and traffic. So it should be better to use MAM (mod_mam_meta module) and leave to the client the task to retrieve offline messages following this approach xep-0313.html#query.