Adding Logic to Messages and Working with Subscriptions

Introduction

We have completed integrating authentication, as well as adding and protecting the Home.vue component. Now, let’s add the following functionalities:

  • Add user contacts—in this case, we will manually add user contacts.
  • Create a group conversation and list it in the inbox
  • Add user to a group conversation.
  • Create an individual conversation and list it in the inbox.
  • Create a message for a group conversation.
  • Create a message for an individual conversation.
  • Add subscription.
  • Test conversation between two users.

Now that we have listed the steps, we can go through each of them. In this section, take note of the logic because it is important.

Add user contacts

The first step is to add user contacts. In “Integrating User Authentication and Protecting Routes,” we created two accounts and logged in to both to confirm that they could access the home page. Now, in the drop-down, click “Add new contacts” and all the users will be listed. We can select any user to start a conversation.

Get hands-on with 1200+ tech skills courses.