This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEventListener("DOMContentLoaded", function () { | |
... | |
if (authenticatedUser) { | |
... | |
// main card item. | |
const mainCardEmptyMessage = document.getElementById("main__card-empty"); | |
const mainCardItemContainer = document.getElementById("main__card-item-container"); | |
// main card actions. | |
const mainCardActions = document.getElementById("main__card-actions") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEventListener("DOMContentLoaded", function () { | |
... | |
if (authenticatedUser) { | |
// main card item. | |
const mainCardEmptyMessage = document.getElementById("main__card-empty"); | |
const mainCardItemContainer = document.getElementById("main__card-item-container"); | |
let notificationListenerID = authenticatedUser.uid; | |
... | |
const addFriend = (matchRequestFrom, matchRequestTo, matchRequestReceiver) => { | |
if (matchRequestFrom && matchRequestTo) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEventListener("DOMContentLoaded", function () { | |
... | |
const authenticatedUser = JSON.parse(localStorage.getItem("auth")); | |
if (authenticatedUser) { | |
... | |
// main card item. | |
const mainCardEmptyMessage = document.getElementById("main__card-empty"); | |
const mainCardItemContainer = document.getElementById("main__card-item-container"); | |
// main card actions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEventListener("DOMContentLoaded", function () { | |
... | |
const authenticatedUser = JSON.parse(localStorage.getItem("auth")); | |
if (authenticatedUser) { | |
... | |
// match requests dialog | |
const requestsEmpty = document.getElementById("requests__empty"); | |
const requestsBtn = document.getElementById("requests-trigger"); | |
const requestsCloseBtn = document.getElementById("requests__close"); | |
const requestsContainer = document.getElementById("requests"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEventListener("DOMContentLoaded", function () { | |
... | |
const authenticatedUser = JSON.parse(localStorage.getItem("auth")); | |
if (authenticatedUser) { | |
... | |
const addFriend = (matchRequestFrom, matchRequestTo) => { | |
if (matchRequestFrom && matchRequestTo) { | |
const url = `https://${config.CometChatAppId}.api-${config.CometChatRegion}.cometchat.io/v3.0/users/${matchRequestTo}/friends`; | |
axios.post(url, { accepted: [matchRequestFrom] }, {headers: { | |
Accept: "application/json", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEventListener("DOMContentLoaded", function () { | |
... | |
const authenticatedUser = JSON.parse(localStorage.getItem("auth")); | |
if (authenticatedUser) { | |
... | |
// main left messages | |
const mainLeftMessagesContainer = document.getElementById("main__left-messages"); | |
const mainLeftEmpty = document.getElementById("main__left-empty"); | |
... | |
const renderFriends = (userList) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEventListener("DOMContentLoaded", function () { | |
... | |
// set header information | |
const authenticatedUser = JSON.parse(localStorage.getItem("auth")); | |
if (authenticatedUser) { | |
... | |
// chatbox | |
const chatBox = document.getElementById("chatbox"); | |
const chatBoxUserAvatar = document.getElementById("chatbox__user-avatar"); | |
const chatBoxUserName = document.getElementById("chatbox__user-name"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
logoutButon.addEventListener("click", function () { | |
const isLeaved = confirm("Do you want to log out?"); | |
if (isLeaved) { | |
// logout from cometchat and then clear storage. | |
CometChat.logout().then((response) => { | |
// User successfully logged out. | |
// Perform any clean up if required. | |
localStorage.removeItem("auth"); | |
// redirect to login page. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEventListener("DOMContentLoaded", function () { | |
... | |
const authenticatedUser = JSON.parse(localStorage.getItem("auth")); | |
if (authenticatedUser) { | |
... | |
// call | |
const callingDialog = document.getElementById("calling"); | |
const acceptCallBtn = document.getElementById("accept-call"); | |
const rejectCallBtn = document.getElementById("reject-call"); | |
const audioCallBtn = document.getElementById("audio-call"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.cometchat.chatapp; | |
import android.app.ProgressDialog; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.widget.Button; | |
import android.widget.EditText; | |
import android.widget.TextView; | |
import android.widget.Toast; |