xmppejabberdxmppframeworkejabberd-moduleejabberd-api

How to get latest room subject from ejabberd/xmpp?


I changed 'Subject' of a chat room but I am not getting this latest subject name. I am using 'disco#info' to get the room info. In response, I am getting room title that was set initially while creating the room but not the latest room subject. How can I get the latest room subject ?


Solution

  • Had to customize the Erlang module mod_muc_room.erl.

    Did these changes in iq_disco_info_extras:

    1. Created a new function get_subject which gets the room subject from StateData.
    2. Added a new parameter in iq_disco_info_extras to get room subject and called the function RoomSubject = get_subject(StateData).
    3. Added a new RFIELD as ?RFIELD(<<"Room subject">>, <<"muc#roominfo_subject">>, RoomSubject),
    4. Compiled the module mod_muc_room.erl, which updated the mod_muc_room.beam file.

    Tada...that worked like a piece of cake!

    Now getting subject name in roominfo.