Custom Module

Custom module allows you to integrate custom actions in the dropdown menu of chat window. Such as displaying the profile of user with whom a connected user is chatting or any action related to the opened chat window.

To create a custom MQTT chat module, you need to add java class that extends moduleA abstract class.

For example the module below allows to display the profile of the user corresponding to the current discussion by clicking on the menu.

public class userProfile extends com.telifoun.mqttchat.modules.moduleA {
* @param ctx
* @param Name
* @param Label
public userProfile(android.content.Context ctx, String Name, String Label) {
super(ctx, Name, Label);
public void moduleMenuItemCLicked() {
/* lounch profile activity on menu item click */
Intent i = new Intent(getMessageActivity(), ProfileActivity.class);
i.putExtra("userId", getMessageActivity().getToUserid());

Then add module to your Application class.

serProfile mProfile=new userProfile(getApplicationContext(),"User Profile","Go to Profile");