repo_name string | dataset string | owner string | lang string | func_name string | code string | docstring string | url string | sha string |
|---|---|---|---|---|---|---|---|---|
design-studio | github_2023 | Tiledesk | typescript | FirebaseAuthService.sendPasswordResetEmail | sendPasswordResetEmail(email: string): any {
const that = this;
return this.firebase.auth().sendPasswordResetEmail(email).then(() => {
that.logger.debug('[FIREBASEAuthSERVICE] firebase-send-password-reset-email');
// that.firebaseSendPasswordResetEmail.next(email);
}).catch((error) => {
th... | /**
* FIREBASE: sendPasswordResetEmail
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-auth-service.ts#L169-L177 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseAuthService.signOut | private signOut(): Promise<boolean> {
const that = this;
return new Promise((resolve, reject)=> {that.firebase.auth().signOut().then(() => {
that.logger.debug('[FIREBASEAuthSERVICE] firebase-sign-out');
// cancello token
// this.appStorage.removeItem('tiledeskToken');
//localStorag... | /**
* FIREBASE: signOut
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-auth-service.ts#L182-L196 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseAuthService.delete | delete() {
const that = this;
this.firebase.auth().currentUser.delete().then(() => {
that.logger.debug('[FIREBASEAuthSERVICE] firebase-current-user-delete');
// that.firebaseCurrentUserDelete.next();
}).catch((error) => {
that.logger.error('[FIREBASEAuthSERVICE] delete error: ', error);
... | /**
* FIREBASE: currentUser delete
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-auth-service.ts#L202-L210 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseAuthService.createCustomToken | createCustomToken(tiledeskToken: string) {
const headers = new HttpHeaders({
'Content-type': 'application/json',
Authorization: tiledeskToken
});
const responseType = 'text';
const postData = {};
const that = this;
this.http.post(this.URL_TILEDESK_CREATE_CUSTOM_TOKEN, postData, { hea... | /**
*
* @param token
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-auth-service.ts#L219-L234 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseConversationHandler.initialize | async initialize(recipientId: string, recipientFullName: string, loggedUser: UserModel, tenant: string, translationMap: Map<string, string>) {
this.logger.log('[FIREBASEConversationHandlerSERVICE] initWithRecipient', recipientId, recipientFullName, loggedUser, tenant, translationMap)
this.recipientId = ... | /**
* inizializzo conversation handler
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-conversation-handler.ts#L66-L86 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseConversationHandler.connect | connect() {
this.lastDate = '';
const that = this;
this.urlNodeFirebase = conversationMessagesRef(this.tenant, this.loggedUser.uid);
this.urlNodeFirebase = this.urlNodeFirebase + this.conversationWith;
this.logger.debug('[FIREBASEConversationHandlerSERVICE] urlNodeFirebase *****'... | /**
* mi connetto al nodo messages
* recupero gli ultimi 100 messaggi
* creo la reference
* mi sottoscrivo a change, removed, added
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-conversation-handler.ts#L94-L116 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseConversationHandler.sendMessage | sendMessage(
msg: string,
typeMsg: string,
metadataMsg: string,
conversationWith: string,
conversationWithFullname: string,
sender: string,
senderFullname: string,
channelType: string,
attributes: any
) {
const that = this;
if (... | /**
* bonifico url in testo messaggio
* recupero time attuale
* recupero lingua app
* recupero senderFullname e recipientFullname
* aggiungo messaggio alla reference
* @param msg
* @param conversationWith
* @param conversationWithDetailFullname
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-conversation-handler.ts#L129-L204 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseConversationHandler.dispose | dispose() {
// this.ref.off();
} | /**
* dispose reference della conversazione
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-conversation-handler.ts#L209-L211 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseConversationHandler.added | private added(childSnapshot: any) {
const msg = this.messageGenerate(childSnapshot);
// msg.attributes && msg.attributes['subtype'] === 'info'
if (this.skipMessage && messageType(MESSAGE_TYPE_INFO, msg)) {
return;
}
if(!this.skipMessage && messageType(MESSAGE_TYPE_INF... | /** */ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-conversation-handler.ts#L248-L259 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseConversationHandler.changed | private changed(childSnapshot: any) {
const msg = this.messageGenerate(childSnapshot);
// imposto il giorno del messaggio per visualizzare o nascondere l'header data
// msg.attributes && msg.attributes['subtype'] === 'info'
if (this.skipMessage && messageType(MESSAGE_TYPE_INFO, msg)) {
... | /** */ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-conversation-handler.ts#L279-L289 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseConversationHandler.removed | private removed(childSnapshot: any) {
const index = searchIndexInArrayForUid(this.messages, childSnapshot.key);
// controllo superfluo sarà sempre maggiore
if (index > -1) {
this.messages.splice(index, 1);
this.messageRemoved.next(childSnapshot.key);
}
} | /** */ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-conversation-handler.ts#L292-L299 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseConversationHandler.messageGenerate | private messageGenerate(childSnapshot: any) {
const msg: MessageModel = childSnapshot.val();
msg.uid = childSnapshot.key;
msg.text = msg.text.trim() //remove black msg with only spaces
// controllo fatto per i gruppi da rifattorizzare
if (!msg.sender_fullname || msg.sender_fullna... | /** */ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-conversation-handler.ts#L302-L327 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseConversationHandler.addRepalceMessageInArray | private addRepalceMessageInArray(key: string, msg: MessageModel) {
const index = searchIndexInArrayForUid(this.messages, key);
if (index > -1) {
this.messages.splice(index, 1, msg);
} else {
this.messages.splice(0, 0, msg);
}
this.messages.sort(compareValu... | /** */ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-conversation-handler.ts#L355-L365 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseConversationHandler.translateInfoSupportMessages | private translateInfoSupportMessages(message: MessageModel) {
// check if the message attributes has parameters and it is of the "MEMBER_JOINED_GROUP" type
const INFO_SUPPORT_USER_ADDED_SUBJECT = this.translationMap.get('INFO_SUPPORT_USER_ADDED_SUBJECT');
const INFO_SUPPORT_USER_ADDED_YOU_VERB =... | /** */ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-conversation-handler.ts#L368-L438 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseConversationHandler.setStatusMessage | private setStatusMessage(msg: MessageModel, conversationWith: string) {
if (msg.status < MSG_STATUS_RECEIVED) {
if (msg.sender !== this.loggedUser.uid && msg.status < MSG_STATUS_RECEIVED) {
const urlNodeMessagesUpdate = this.urlNodeFirebase + '/' + msg.uid;
this.logge... | /**
* aggiorno lo stato del messaggio
* questo stato indica che è stato consegnato al client e NON che è stato letto
* se il messaggio NON è stato inviato da loggedUser AGGIORNO stato a 200
* @param item
* @param conversationWith
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-conversation-handler.ts#L448-L456 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseConversationHandler.isValidField | private isValidField(field: any): boolean {
return (field === null || field === undefined) ? false : true;
} | /**
*
* @param field
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-conversation-handler.ts#L497-L499 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseConversationsHandler.initialize | async initialize(tenant: string,userId: string,translationMap: Map<string, string>) {
this.tenant = tenant;
this.loggedUserId = userId;
this.translationMap = translationMap;
this.conversations = [];
this.isConversationClosingMap = new Map();
//this.databaseProvider.initia... | /**
* inizializzo conversations handler
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-conversations-handler.ts#L69-L84 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseConversationsHandler.subscribeToConversations | subscribeToConversations(callback) {
const that = this;
const urlNodeFirebase = conversationsPathForUserId(this.tenant, this.loggedUserId);
this.logger.debug('[FIREBASEConversationsHandlerSERVICE] SubscribeToConversations conversations::ACTIVE urlNodeFirebase', urlNodeFirebase)
this.ref ... | //---------------------------------------------------------------------------------- | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-conversations-handler.ts#L120-L142 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseConversationsHandler.countIsNew | countIsNew(): number {
let num = 0;
this.conversations.forEach((element) => {
if (element.is_new === true) {
num++;
}
});
return num;
} | /**
* restituisce il numero di conversazioni nuove
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-conversations-handler.ts#L186-L194 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseConversationsHandler.getClosingConversation | getClosingConversation(conversationId: string) {
return this.isConversationClosingMap[conversationId];
} | /**
* Returns the status of the conversations with conversationId from isConversationClosingMap
* @param conversationId the conversation id
* @returns true if the conversation is waiting to be closed, false otherwise
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-conversations-handler.ts#L209-L211 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseConversationsHandler.setClosingConversation | setClosingConversation(conversationId: string, status: boolean) {
this.isConversationClosingMap[conversationId] = status;
} | /**
* Add the conversation with conversationId to the isConversationClosingMap
* @param conversationId the id of the conversation of which it wants to save the state
* @param status true if the conversation is waiting to be closed, false otherwise
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-conversations-handler.ts#L218-L220 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseConversationsHandler.deleteClosingConversation | deleteClosingConversation(conversationId: string) {
this.isConversationClosingMap.delete(conversationId);
} | /**
* Delete the conversation with conversationId from the isConversationClosingMap
* @param conversationId the id of the conversation of which is wants to delete
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-conversations-handler.ts#L226-L228 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseConversationsHandler.archiveConversation | archiveConversation(conversationId: string) {
const that = this
this.setClosingConversation(conversationId, true);
this.setConversationRead(conversationId)
const index = searchIndexInArrayForUid(this.conversations, conversationId);
// if (index > -1) {
// this.convers... | // -------->>>> ARCHIVE CONVERSATION SECTION START <<<<---------------// | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-conversations-handler.ts#L231-L251 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseConversationsHandler.getConversationDetail | public getConversationDetail(conversationId: string, callback: (conv: ConversationModel) => void): void {
// fare promise o callback ??
const conversation = this.conversations.find(item => item.uid === conversationId);
this.logger.debug('[FIREBASEConversationsHandlerSERVICE] conversations *****... | // -------->>>> ARCHIVE CONVERSATION SECTION END <<<<---------------// | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-conversations-handler.ts#L307-L360 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseConversationsHandler.dispose | dispose() {
this.conversations = [];
this.uidConvSelected = '';
//this.ref.off();
// this.ref.off("child_changed");
// this.ref.off("child_removed");
// this.ref.off("child_added");
this.logger.debug('[FIREBASEConversationsHandlerSERVICE] DISPOSE::: ', this.ref)
... | /**
* dispose reference di conversations
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-conversations-handler.ts#L364-L372 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseConversationsHandler.conversationGenerate | private conversationGenerate(childSnapshot: any): boolean {
const childData: ConversationModel = childSnapshot.val();
childData.uid = childSnapshot.key;
const conversation = this.completeConversation(childData);
if (this.isValidConversation(conversation)) {
this.setClosingCon... | // */ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-conversations-handler.ts#L397-L415 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseConversationsHandler.added | private added(childSnapshot: any) {
if (this.conversationGenerate(childSnapshot)) {
const index = searchIndexInArrayForUid(this.conversations, childSnapshot.key);
if (index > -1) {
const conversationAdded = this.conversations[index]
this.conversat... | //TODO-GAB: ora emit singola conversation e non dell'intero array di conversations | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-conversations-handler.ts#L456-L467 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseConversationsHandler.changed | private changed(childSnapshot: any) {
const oldConversation = this.conversations[searchIndexInArrayForUid(this.conversations, childSnapshot.key)]
//skip info message updates
if(messageType(MESSAGE_TYPE_INFO, childSnapshot.val()) ){
return;
}
if (this.conversationGener... | //TODO-GAB: ora emit singola conversation e non dell'intero array di conversations | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-conversations-handler.ts#L480-L496 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseConversationsHandler.removed | private removed(childSnapshot: any) {
const index = searchIndexInArrayForUid(this.conversations, childSnapshot.key);
if (index > -1) {
const conversationRemoved = this.conversations[index]
this.conversations.splice(index, 1);
// this.conversations.sort(compareValues('... | //TODO-GAB: ora emit singola conversation e non dell'intero array di conversations | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-conversations-handler.ts#L506-L517 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseConversationsHandler.completeConversation | private completeConversation(conv): ConversationModel {
this.logger.debug('[FIREBASEConversationsHandlerSERVICE] completeConversation --> conv from firebase', conv)
conv.selected = false;
if (!conv.sender_fullname || conv.sender_fullname === 'undefined' || conv.sender_fullname.trim() === '') {
... | /**
* Completo conversazione aggiungendo:
* 1 - nel caso in cui sender_fullname e recipient_fullname sono vuoti, imposto i rispettivi id come fullname,
* in modo da avere sempre il campo fullname popolato
* 2 - imposto conversation_with e conversation_with_fullname con i valori del sender o a... | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-conversations-handler.ts#L533-L566 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseConversationsHandler.setStatusConversation | private setStatusConversation(sender: string, uid: string): string {
let status = '0'; // letto
if (sender === this.loggedUserId || uid === this.uidConvSelected) {
status = '0';
} else {
status = '1'; // non letto
}
return status;
} | /** */ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-conversations-handler.ts#L569-L577 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseConversationsHandler.isValidConversation | private isValidConversation(convToCheck: ConversationModel): boolean {
if (!this.isValidField(convToCheck.uid)) {
return false;
}
if (!this.isValidField(convToCheck.is_new)) {
return false;
}
if (!this.isValidField(convToCheck.last_message_text)) {
... | /**
* check if the conversations is valid or not
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-conversations-handler.ts#L582-L615 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseConversationsHandler.isValidField | private isValidField(field: any): boolean {
return (field === null || field === undefined) ? false : true;
} | /**
*
* @param field
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-conversations-handler.ts#L621-L623 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseGroupsHandler.initialize | async initialize(tenant: string, loggedUserId: string) {
this.tenant = tenant;
this.loggedUserId = loggedUserId;
this.BASE_URL = this.appConfig.getConfig().firebaseConfig.chat21ApiUrl;
this.logger.debug('[FIREBASEGroupHandlerSERVICE] initialize', this.tenant, this.loggedUserId);
... | /**
* inizializzo groups handler
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-groups-handler.ts#L62-L72 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseGroupsHandler.connect | connect() {
//********* NOT IN USE ********** */
const that = this;
const urlNodeGroups = '/apps/' + this.tenant + '/users/' + this.loggedUserId + '/groups';
this.logger.debug('[FIREBASEGroupHandlerSERVICE] connect -------> groups::', urlNodeGroups)
this.ref = this.firebase.datab... | /**
* mi connetto al nodo groups
* creo la reference
* mi sottoscrivo a change, removed, added
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-groups-handler.ts#L79-L97 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseGroupsHandler.getDetail | getDetail(groupId: string, callback?: (group: GroupModel)=>void): Promise<GroupModel>{
const urlNodeGroupById = '/apps/' + this.tenant + '/users/' + this.loggedUserId + '/groups/' + groupId;
this.logger.debug('[FIREBASEGroupHandlerSERVICE] getDetail -------> urlNodeGroupById::', urlNodeGroupById)
... | /**
* mi connetto al nodo groups/GROUPID
* creo la reference
* mi sottoscrivo a value
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-groups-handler.ts#L104-L121 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseGroupsHandler.create | create(groupName: string, members: [string], callback?: (res: any, error: any) => void): Promise<any> {
var that = this;
let listMembers = {};
members.forEach(member => {
listMembers[member] = 1
});
return new Promise((resolve, reject) =>{
this.getFirebas... | // } | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-groups-handler.ts#L162-L200 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseGroupsHandler.getFirebaseToken | private getFirebaseToken(callback) {
const firebase_currentUser = this.firebase.auth().currentUser;
this.logger.debug('[FIREBASEGroupHandlerSERVICE] // firebase current user ', firebase_currentUser);
if (firebase_currentUser) {
const that = this;
firebase_currentUser.get... | // // -------->>>> PRIVATE METHOD SECTION START <<<<---------------// | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-groups-handler.ts#L279-L294 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseImageRepoService.getImagePhotoUrl | getImagePhotoUrl(uid: string): string {
this.baseImageURL = this.getImageBaseUrl()
let sender_id = '';
if (uid && uid.includes('bot_')) {
sender_id = uid.slice(4)
} else {
sender_id = uid
}
const firebase_photo = '/o/profiles%2F'+ sender_id + '%2Fp... | /**
* @param uid
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-image-repo.ts#L31-L43 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebasePresenceService.initialize | public async initialize(tenant: string) {
// this.tenant = this.getTenant();
this.tenant = tenant;
this.logger.debug('[FIREBASEPresenceSERVICE] initialize this.tenant', this.tenant);
this.urlNodePresence = '/apps/' + this.tenant + '/presence/';
const { default: firebase} = await import("firebase/ap... | /**
*
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-presence.service.ts#L41-L51 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebasePresenceService.userIsOnline | public userIsOnline(userid: string): Observable<any> {
const that = this;
let local_BSIsOnline = new BehaviorSubject<any>(null);
const urlNodeConnections = this.urlNodePresence + userid + '/connections';
this.logger.debug('[FIREBASEPresenceSERVICE] userIsOnline: ', urlNodeConnections);
const connect... | // } | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-presence.service.ts#L77-L95 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebasePresenceService.lastOnlineForUser | public lastOnlineForUser(userid: string) {
this.logger.debug('[FIREBASEPresenceSERVICE] lastOnlineForUser', userid);
const that = this;
const lastOnlineRef = this.referenceLastOnlineForUser(userid);
lastOnlineRef.on('value', (child) => {
if (child.val()) {
this.BSLastOnline.next({ uid: use... | /**
* lastOnlineForUser
* @param userid
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-presence.service.ts#L102-L113 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebasePresenceService.setPresence | public setPresence(userid: string): void {
this.onlineConnectionsRef = this.referenceOnlineForUser(userid);
this.lastOnlineConnectionsRef = this.referenceLastOnlineForUser(userid);
const connectedRefURL = '/.info/connected';
const conn = this.firebase.database().ref(connectedRefURL);
conn.on('value'... | /**
* 1 - imposto reference online/offline
* 2 - imposto reference lastConnection
* 3 - mi sincronizzo con /.info/connected
* 4 - se il valore esiste l'utente è online
* 5 - aggiungo nodo a connection (true)
* 6 - aggiungo job su onDisconnect di deviceConnectionRef che rimuove nodo connection
* 7 -... | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-presence.service.ts#L128-L147 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebasePresenceService.removePresence | public removePresence(): void {
if (this.onlineConnectionsRef) {
const now: Date = new Date();
const timestamp = now.valueOf();
this.lastOnlineConnectionsRef.set(timestamp);
this.onlineConnectionsRef.off();
this.onlineConnectionsRef.remove();
this.logger.debug('[FIREBASEPresenceS... | /**
* removePresence
* richiamato prima del logout
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-presence.service.ts#L157-L166 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebasePresenceService.referenceLastOnlineForUser | private referenceLastOnlineForUser(userid: string): any {
const urlNodeLastOnLine = this.urlNodePresence + userid + '/lastOnline';
this.logger.log('referenceLastOnlineForUser', urlNodeLastOnLine)
const lastOnlineRef = this.firebase.database().ref().child(urlNodeLastOnLine);
return lastOnlineRef;
} | /**
* recupero la reference di lastOnline del currentUser
* usata in setupMyPresence
* @param userid
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-presence.service.ts#L173-L178 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebasePresenceService.referenceOnlineForUser | private referenceOnlineForUser(userid: string): any {
const urlNodeConnections = this.urlNodePresence + userid + '/connections';
const connectionsRef = this.firebase.database().ref().child(urlNodeConnections);
return connectionsRef;
} | /**
* recupero la reference di connections (online/offline) del currentUser
* usata in setupMyPresence
* @param userid
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-presence.service.ts#L185-L189 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseTypingService.initialize | public async initialize(tenant: string) {
this.tenant = tenant;
this.logger.debug('[FIREBASETypingSERVICE] initialize - tenant ', this.tenant)
this.urlNodeTypings = '/apps/' + this.tenant + '/typings/';
const { default: firebase} = await import("firebase/app");
await Promise.all([import("firebase/d... | /** */ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-typing.service.ts#L49-L59 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseTypingService.isTyping | public isTyping(idConversation: string, idCurrentUser: string, isDirect: boolean ) {
const that = this;
let urlTyping = this.urlNodeTypings + idConversation;
if (isDirect) {
urlTyping = this.urlNodeTypings + idCurrentUser + '/' + idConversation;
}
this.logger.debug('[FIREBASETypingSERVICE] url... | /** */ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-typing.service.ts#L62-L75 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseTypingService.setTyping | public setTyping(idConversation: string, message: string, recipientId: string, userFullname: string) {
const that = this;
clearTimeout(this.setTimeoutWritingMessages);
this.setTimeoutWritingMessages = setTimeout(() => {
const urlTyping = this.urlNodeTypings + idConversation + '/' + recipientId;// + '/... | /** */ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-typing.service.ts#L78-L94 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | FirebaseUploadService.deleteFile | private deleteFile(pathToFile, fileName){
const ref = this.firebase.storage().ref(pathToFile);
const childRef = ref.child(fileName);
return childRef.delete()
} | // // ------------------------------------ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-upload.service.ts#L231-L235 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTArchivedConversationsHandler.initialize | initialize(tenant: string, userId: string,translationMap: Map<string, string>) {
this.logger.debug('[MQTTArchivedConversationsHandler] initialize');
this.loggedUserId = userId;
this.translationMap = translationMap;
this.archivedConversations = [];
this.isConversationClosingMap =... | /**
* inizializzo conversations handler
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-archivedconversations-handler.ts#L51-L57 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTArchivedConversationsHandler.subscribeToConversations | subscribeToConversations(loaded) {
this.logger.debug('[MQTTArchivedConversationsHandler] connecting MQTT conversations handler');
const handlerConversationAdded = this.chat21Service.chatClient.onArchivedConversationAdded( (conv) => {
this.logger.log('[MQTTArchivedConversationsHandler] Added ... | //---------------------------------------------------------------------------------- | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-archivedconversations-handler.ts#L144-L167 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTArchivedConversationsHandler.added | private added(childSnapshot: any) {
this.logger.debug('[MQTTArchivedConversationsHandler] NEW CONV childSnapshot', childSnapshot)
let conversation = this.completeConversation(childSnapshot);
conversation.uid = conversation.conversation_with;
// console.log("NUOVA CONVER;" + conversation... | /**
* 1 - completo la conversazione con i parametri mancanti
* 2 - verifico che sia una conversazione valida
* 3 - salvo stato conversazione (false) nell'array delle conversazioni chiuse
* 4 - aggiungo alla pos 0 la nuova conversazione all'array di conversazioni
* o sostituisco la con... | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-archivedconversations-handler.ts#L180-L208 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTArchivedConversationsHandler.removed | private removed(childSnapshot) {
const index = searchIndexInArrayForUid(this.archivedConversations, childSnapshot.key);
if (index > -1) {
const conversationRemoved = this.archivedConversations[index]
this.archivedConversations.splice(index, 1);
// this.conversations.s... | /**
* 1 - cerco indice conversazione da eliminare
* 2 - elimino conversazione da array conversations
* 3 - elimino la conversazione dallo storage
* 4 - pubblico conversations:update
* 5 - elimino conversazione dall'array delle conversazioni chiuse
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-archivedconversations-handler.ts#L254-L265 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTArchivedConversationsHandler.dispose | dispose() {
this.archivedConversations = [];
this.archivedConversations.length = 0;
this.uidConvSelected = '';
} | /**
* dispose reference di conversations
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-archivedconversations-handler.ts#L270-L274 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTArchivedConversationsHandler.completeConversation | private completeConversation(conv): ConversationModel {
// conv.selected = false;
if (!conv.sender_fullname || conv.sender_fullname === 'undefined' || conv.sender_fullname.trim() === '') {
conv.sender_fullname = conv.sender;
}
if (!conv.recipient_fullname || conv.recipient_fu... | /**
* Completo conversazione aggiungendo:
* 1 - nel caso in cui sender_fullname e recipient_fullname sono vuoti, imposto i rispettivi id come fullname,
* in modo da avere sempre il campo fullname popolato
* 2 - imposto conversation_with e conversation_with_fullname con i valori del sender o a... | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-archivedconversations-handler.ts#L308-L336 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTArchivedConversationsHandler.setStatusConversation | private setStatusConversation(sender, uid): string {
let status = '0'; // letto
if (sender === this.loggedUserId || uid === this.uidConvSelected) {
status = '0';
} else {
status = '1'; // non letto
}
return status;
} | /** */ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-archivedconversations-handler.ts#L363-L371 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTArchivedConversationsHandler.countIsNew | countIsNew(): number {
let num = 0;
this.archivedConversations.forEach((element) => {
if (element.is_new === true) {
num++;
}
});
return num;
} | /**
* restituisce il numero di conversazioni nuove
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-archivedconversations-handler.ts#L376-L384 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTArchivedConversationsHandler.isValidConversation | private isValidConversation(convToCheck: ConversationModel) : boolean {
//console.log("[BEGIN] ChatConversationsHandler:: convToCheck with uid: ", convToCheckId);
this.logger.debug('[MQTTArchivedConversationsHandler] checking uid of', convToCheck)
this.logger.debug('[MQTTArchivedConversationsHan... | /**
* check if the conversations is valid or not
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-archivedconversations-handler.ts#L418-L467 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTArchivedConversationsHandler.isValidField | private isValidField(field) : boolean{
return (field === null || field === undefined) ? false : true;
} | // checks if a conversation's field is valid or not | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-archivedconversations-handler.ts#L470-L472 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTAuthService.initialize | initialize() {
this.SERVER_BASE_URL = this.getBaseUrl();
this.URL_TILEDESK_CREATE_CUSTOM_TOKEN = this.SERVER_BASE_URL + 'chat21/native/auth/createCustomToken';
this.logger.log('[MQTTAuthService] initialize ');
// this.checkIsAuth();
// this.onAuthStateChanged();
} | /**
*
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-auth-service.ts#L51-L57 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTAuthService.logout | logout(): Promise<boolean> {
this.logger.debug("[MQTTAuthService] logout: closing mqtt connection...");
return new Promise((resolve, reject) => {
this.chat21Service.chatClient.close(() => {
// remove
// this.appStorage.removeItem('tiledeskToken');
// this.appStorage.removeItem('cur... | // logout(callback) { | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-auth-service.ts#L60-L77 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTAuthService.getUser | getUser(): any {
return this.currentUser;
} | /**
*
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-auth-service.ts#L82-L84 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTAuthService.getToken | getToken(): string {
this.logger.debug('[MQTTAuthService]::getToken');
return this.token;
} | /** */ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-auth-service.ts#L89-L92 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTAuthService.createCustomToken | createCustomToken(tiledeskToken: any): void {
this.connectWithCustomToken(tiledeskToken)
} | // } | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-auth-service.ts#L124-L126 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTAuthService.connectWithCustomToken | private connectWithCustomToken(tiledeskToken: string): any {
const headers = new HttpHeaders({
'Content-type': 'application/json',
Authorization: tiledeskToken
});
const responseType = 'text';
const postData = {};
// const that = this;
this.http.post(this.URL_TILEDESK_CREATE_CUSTOM_T... | // } | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-auth-service.ts#L241-L257 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTConversationHandler.initialize | initialize(recipientId: string,recipientFullName: string,loggedUser: UserModel,tenant: string, translationMap: Map<string, string>) {
this.logger.log('[MQTTConversationHandler] initWithRecipient:', tenant);
this.recipientId = recipientId;
this.recipientFullname = recipientFullName;
this.... | /**
* inizializzo conversation handler
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts#L70-L86 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTConversationHandler.connect | connect() {
this.logger.log('[MQTTConversationHandler] connecting conversation handler...', this.conversationWith);
if (this.conversationWith == null) {
this.logger.error('[MQTTConversationHandler] cant connect invalid this.conversationWith', this.conversationWith);
return;
... | /**
* mi connetto al nodo messages
* recupero gli ultimi 100 messaggi
* creo la reference
* mi sottoscrivo a change, removed, added
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts#L94-L130 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTConversationHandler.sendMessage | sendMessage(
msg: string,
typeMsg: string,
metadataMsg: string,
conversationWith: string,
conversationWithFullname: string,
sender: string,
senderFullname: string,
channelType: string,
attributes: any
) {
const that = this;
if (... | // ); | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts#L159-L235 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTConversationHandler.dispose | dispose() {
// this.ref.off();
} | /**
* dispose reference della conversazione
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts#L240-L242 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTConversationHandler.addedMessage | private addedMessage(messageSnapshot: any) {
const msg = this.messageGenerate(messageSnapshot);
if(this.skipInfoMessage && messageType(MESSAGE_TYPE_INFO, msg)){
return;
}
if(!this.skipInfoMessage && messageType(MESSAGE_TYPE_INFO, msg)){
this.messageInfo.n... | /** */ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts#L265-L282 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTConversationHandler.changed | private changed(patch: any) {
if(this.skipInfoMessage && messageType(MESSAGE_TYPE_INFO, patch) ){
return;
}
this.logger.log('[MQTTConversationHandler] updating message with patch', patch);
const index = searchIndexInArrayForUid(this.messages, patch.message_id);
if (in... | /** */ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts#L285-L300 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTConversationHandler.removed | private removed(childSnapshot: any) {
const index = searchIndexInArrayForUid(this.messages, childSnapshot.key);
// controllo superfluo sarà sempre maggiore
if (index > -1) {
this.messages.splice(index, 1);
this.messageRemoved.next(childSnapshot.key);
}
} | /** */ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts#L303-L310 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTConversationHandler.messageGenerate | private messageGenerate(childSnapshot: any) {
// const msg: MessageModel = childSnapshot.val();
this.logger.log("[MQTTConversationHandler] childSnapshot >" + JSON.stringify(childSnapshot));
const msg = childSnapshot;
// msg.uid = childSnapshot.key;
msg.text = msg.text? msg.text.t... | /** */ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts#L313-L335 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTConversationHandler.addReplaceMessageInArray | private addReplaceMessageInArray(uid: string, msg: MessageModel) {
const index = searchIndexInArrayForUid(this.messages, uid);
if (index > -1) {
// const headerDate = this.messages[index].headerDate;
// msg.headerDate = headerDate;
this.messages.splice(index, 1, msg);... | /** */ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts#L338-L348 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTConversationHandler.translateInfoSupportMessages | private translateInfoSupportMessages(message: MessageModel) {
// check if the message attributes has parameters and it is of the "MEMBER_JOINED_GROUP" type
const INFO_SUPPORT_USER_ADDED_SUBJECT = this.translationMap.get('INFO_SUPPORT_USER_ADDED_SUBJECT');
const INFO_SUPPORT_USER_ADDED_YOU_VERB =... | /** */ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts#L351-L420 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTConversationHandler.updateMessageStatusReceived | private updateMessageStatusReceived(msg) {
this.logger.log('[MQTTConversationHandler] updateMessageStatusReceived', msg);
if (msg['status'] < MSG_STATUS_RECEIVED && msg['status'] > 0) {
this.logger.log('[MQTTConversationHandler] status ', msg['status'], ' < (RECEIVED:200)', MSG_STATUS_RECEIV... | /**
* aggiorno lo stato del messaggio
* questo stato indica che è stato consegnato al client e NON che è stato letto
* se il messaggio NON è stato inviato da loggedUser AGGIORNO stato a 200
* @param item
* @param conversationWith
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts#L430-L446 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTConversationsHandler.subscribeToConversations | subscribeToConversations(lastTimestamp, loaded) {
// lastTimestamp temporarily ignored
this.logger.debug('[MQTTConversationsHandler] connecting MQTT conversations handler');
const handlerConversationAdded = this.chat21Service.chatClient.onConversationAdded( (conv) => {
let conversat... | //---------------------------------------------------------------------------------- | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts#L150-L197 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTConversationsHandler.changed | private changed(conversation: any) {
// const childData: ConversationModel = childSnapshot;
// childData.uid = childSnapshot.key;
// this.logger.log('changed conversation: ', childData);
// const conversation = this.completeConversation(childData);
this.logger.debug('[MQTTConvers... | /**
* 1 - completo la conversazione con i parametri mancanti
* 2 - verifico che sia una conversazione valida
* 3 - aggiungo alla pos 0 la nuova conversazione all'array di conversazioni
* 4 - salvo la conversazione nello storage
* 5 - ordino l'array per timestamp
* 6 - pubblico conve... | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts#L240-L278 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTConversationsHandler.removed | private removed(childSnapshot) {
const index = searchIndexInArrayForUid(this.conversations, childSnapshot.uid);
if (index > -1) {
const conversationRemoved = this.conversations[index]
this.conversations.splice(index, 1);
// this.conversations.sort(compareValues('times... | /**
* 1 - cerco indice conversazione da eliminare
* 2 - elimino conversazione da array conversations
* 3 - elimino la conversazione dallo storage
* 4 - pubblico conversations:update
* 5 - elimino conversazione dall'array delle conversazioni chiuse
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts#L341-L353 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTConversationsHandler.dispose | dispose() {
this.conversations.length = 0;
this.conversations = [];
this.uidConvSelected = '';
} | /**
* dispose reference di conversations
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts#L358-L362 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTConversationsHandler.setStatusConversation | private setStatusConversation(sender, uid): string {
let status = '0'; // letto
if (sender === this.loggedUserId || uid === this.uidConvSelected) {
status = '0';
} else {
status = '1'; // non letto
}
return status;
} | /** */ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts#L426-L434 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTConversationsHandler.countIsNew | countIsNew(): number {
let num = 0;
this.conversations.forEach((element) => {
if (element.is_new === true) {
num++;
}
});
return num;
} | /**
* restituisce il numero di conversazioni nuove
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts#L439-L447 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTConversationsHandler.isValidConversation | private isValidConversation(convToCheck: ConversationModel) : boolean {
//this.logger.log("[BEGIN] ChatConversationsHandler:: convToCheck with uid: ", convToCheckId);
this.logger.debug('[MQTTConversationsHandler] checking uid of', convToCheck)
this.logger.debug('[MQTTConversationsHandler] conver... | /**
* check if the conversations is valid or not
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts#L530-L579 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTConversationsHandler.isValidField | private isValidField(field) : boolean{
return (field === null || field === undefined) ? false : true;
} | // checks if a conversation's field is valid or not | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts#L582-L584 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTGroupsHandler.initialize | initialize(tenant: string, loggedUserId: string): void {
this.logger.log('[MQTT-GROUPS-HANDLER] initialize');
this.tenant = tenant;
this.loggedUserId = loggedUserId;
} | /**
* inizializzo groups handler
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-groups-handler.ts#L37-L41 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTGroupsHandler.connect | connect(): void {
// TODO deprecated method.
} | /**
* mi connetto al nodo groups
* creo la reference
* mi sottoscrivo a change, removed, added
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-groups-handler.ts#L48-L50 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTGroupsHandler.getDetail | getDetail(groupId: string, callback?: (group: GroupModel) => void): Promise<GroupModel> {
//throw new Error('Method not implemented.');
// Ignorare versione firebase
this.logger.log('Method not implemented.');
return;
} | /**
* mi connetto al nodo groups/GROUPID
* creo la reference
* mi sottoscrivo a value
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-groups-handler.ts#L57-L62 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTGroupsHandler.onGroupChange | onGroupChange(groupId: string): Observable<GroupModel> {
if (this.isGroup(groupId)) {
this.chat21Service.chatClient.groupData(groupId, (err, group) => {
this.logger.log('[MQTT-GROUPS-HANDLER] onGroupChange: got result by REST call:', group);
this.groupValue(group.resu... | // abstract onGroupChange(groupId: string): Observable<GroupModel>; | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-groups-handler.ts#L64-L78 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTGroupsHandler.leave | leave(groupId: string, callback?: (res: any, error: any) => void): Promise<any> {
// throw new Error('Method not implemented.');
// Ignorare versione firebase
this.logger.log('Method not implemented.');
return;
} | // } | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-groups-handler.ts#L115-L120 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTPresenceService.removePresence | public removePresence(): void {
// if (this.onlineConnectionsRef) {
// const now: Date = new Date();
// const timestamp = now.valueOf();
// this.lastOnlineConnectionsRef.set(timestamp);
// this.onlineConnectionsRef.off();
// this.onlineConnectionsRef.remove();
// console.log('goO... | /**
* removePresence
* richiamato prima del logout
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-presence.service.ts#L109-L118 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTTypingService.initialize | initialize(tenant: string) {
// this.tenant = this.getTenant();
this.tenant = tenant;
this.logger.info('[MQTT-TYPING] initialize this.tenant', this.tenant);
this.urlNodeTypings = '/apps/' + this.tenant + '/typings/';
} | /** */ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-typing.service.ts#L50-L55 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTTypingService.isTyping | isTyping(idConversation: string, idUser: string) {
// const that = this;
// let urlTyping = this.urlNodeTypings + idConversation;
// if (idUser) {
// urlTyping = this.urlNodeTypings + idUser + '/' + idConversation;
// }
// console.log('urlTyping: ', urlTyping);
// const ref = firebase.data... | /** */ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-typing.service.ts#L58-L70 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | MQTTTypingService.setTyping | setTyping(idConversation: string, message: string, idUser: string, userFullname: string) {
// const that = this;
// this.setTimeoutWritingMessages = setTimeout(() => {
// let urlTyping = this.urlNodeTypings + idConversation;
// if (idUser) {
// urlTyping = this.urlNodeTypings + idUser + '/'... | /** */ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/mqtt/mqtt-typing.service.ts#L73-L94 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | NativeImageRepoService.getImagePhotoUrl | getImagePhotoUrl(uid: string): string {
this.baseImageURL = this.getImageBaseUrl() + 'images'
let sender_id = '';
if (uid.includes('bot_')) {
sender_id = uid.slice(4)
} else {
sender_id = uid
}
const filename_photo = '?path=uploads/users/'+ sender_... | /**
* @param uid
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/native/native-image-repo.ts#L18-L29 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | TiledeskAuthService.signInWithEmailAndPassword | signInWithEmailAndPassword(email: string, password: string): Promise<string> {
this.logger.log('[TILEDESK-AUTH-SERV] - signInWithEmailAndPassword', email, password);
const httpHeaders = new HttpHeaders();
httpHeaders.append('Accept', 'application/json');
httpHeaders.append('Content-Type', 'application/... | /**
* @param email
* @param password
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts#L52-L77 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | TiledeskAuthService.signInAnonymously | signInAnonymously(projectID: string): Promise<any> {
this.logger.debug('[TILEDESK-AUTH] - signInAnonymously - projectID', projectID);
const httpHeaders = new HttpHeaders();
httpHeaders.append('Accept', 'application/json');
httpHeaders.append('Content-Type', 'application/json');
const requestOptions... | /**
* @param projectID
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts#L83-L108 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | TiledeskAuthService.signInWithCustomToken | signInWithCustomToken(tiledeskToken: string): Promise<any> {
const headers = new HttpHeaders({
'Content-type': 'application/json',
Authorization: tiledeskToken
});
const requestOptions = { headers: headers };
const that = this;
return new Promise((resolve, reject) => {
this.http.po... | /**
* @param tiledeskToken
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts#L113-L133 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | TiledeskAuthService.createCompleteUser | private createCompleteUser(user: any) {
const member = new UserModel(user._id);
try {
const uid = user._id;
const firstname = user.firstname ? user.firstname : '';
const lastname = user.lastname ? user.lastname : '';
const email = user.email ? user.email : '';
const fullname = (fir... | /**
* createCompleteUser
* @param user
*/ | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts#L159-L184 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
design-studio | github_2023 | Tiledesk | typescript | UserTypingComponent.constructor | constructor(private elementRef: ElementRef) { } | // @Input() membersConversation: [string]; | https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/utils/user-typing/user-typing.component.ts#L20-L20 | 297d30da01d98a1299e7197eb88cff5b2390a386 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.