diff --git a/src/app/models/user.model.ts b/src/app/models/user.model.ts index a0e0855e8..29bc949cd 100644 --- a/src/app/models/user.model.ts +++ b/src/app/models/user.model.ts @@ -75,7 +75,6 @@ export class UserSession { }[] UserName: string Password: string - RochetChatUser: string RochetChatUserId: string Profile: 'PR' | 'MDGPR' | 'Consultant' | 'Department boss' | 'Assistant' | 'Director' | 'Deputy Director' | 'Secretariat' | 'Deputy Director' | 'General secretary' ; LoginPreference: 'None' | 'Password' | 'Pin' | null; diff --git a/src/app/pages/chat/chat.page.ts b/src/app/pages/chat/chat.page.ts index c887f2dc4..5808d4920 100644 --- a/src/app/pages/chat/chat.page.ts +++ b/src/app/pages/chat/chat.page.ts @@ -386,7 +386,7 @@ export class ChatPage implements OnInit { }) this.storageservice.get('chatusers').then((users) => { - this.dmUsers = users.filter(data => data.username != SessionStore.user.RochetChatUser); + this.dmUsers = users.filter(data => data.username != SessionStore.user.UserName); }) } else { this.sqlservice.getAllChatRoom().then((rooms: any) => { @@ -429,7 +429,7 @@ export class ChatPage implements OnInit { chatusersArray.push(userListDB); }); - this.dmUsers = chatusersArray.filter(data => data.username != SessionStore.user.RochetChatUser); + this.dmUsers = chatusersArray.filter(data => data.username != SessionStore.user.UserName); }) } @@ -545,7 +545,7 @@ export class ChatPage implements OnInit { }) this.storageservice.get('chatusers').then((users) => { - this.dmUsers = users.filter(data => data.username != SessionStore.user.RochetChatUser); + this.dmUsers = users.filter(data => data.username != SessionStore.user.UserName); }) } else { this.sqlservice.getAllChatRoom().then((rooms: any) => { diff --git a/src/app/pages/chat/group-messages/group-contacts/group-contacts.page.ts b/src/app/pages/chat/group-messages/group-contacts/group-contacts.page.ts index 861a0881f..a6ae083a2 100644 --- a/src/app/pages/chat/group-messages/group-contacts/group-contacts.page.ts +++ b/src/app/pages/chat/group-messages/group-contacts/group-contacts.page.ts @@ -72,7 +72,7 @@ export class GroupContactsPage implements OnInit { this.contacts = res.users.filter(f => !this.members.some(item => item._id === f._id)); } else{ - this.contacts = res.users.filter(data => data.username != this.sessionStore.user.RochetChatUser); + this.contacts = res.users.filter(data => data.username != this.sessionStore.user.UserName); } this.users = this.contacts.sort((a,b) => { if(a.name < b.name){ diff --git a/src/app/pages/chat/group-messages/group-messages.page.html b/src/app/pages/chat/group-messages/group-messages.page.html index 4dbdffff9..def51fa5d 100644 --- a/src/app/pages/chat/group-messages/group-messages.page.html +++ b/src/app/pages/chat/group-messages/group-messages.page.html @@ -66,7 +66,7 @@ {{msg.msg}} {{msg.msg}} - + @@ -102,7 +102,7 @@ -->
-
+
{{msg.u.name ?? ""}} {{msg.duration}} @@ -124,7 +124,7 @@
image - + @@ -171,7 +171,7 @@ - + diff --git a/src/app/pages/chat/group-messages/group-messages.page.ts b/src/app/pages/chat/group-messages/group-messages.page.ts index 152a6eebf..ec6299674 100644 --- a/src/app/pages/chat/group-messages/group-messages.page.ts +++ b/src/app/pages/chat/group-messages/group-messages.page.ts @@ -393,7 +393,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy { this.chatService.getAllUsers().subscribe(res => { console.log(res); - this.allUsers = res['users'].filter(data => data.username != SessionStore.user.RochetChatUser); + this.allUsers = res['users'].filter(data => data.username != SessionStore.user.UserName); console.log(this.allUsers); }); } diff --git a/src/app/pages/chat/messages/contacts/contacts.page.ts b/src/app/pages/chat/messages/contacts/contacts.page.ts index e8b834c54..fe5945257 100644 --- a/src/app/pages/chat/messages/contacts/contacts.page.ts +++ b/src/app/pages/chat/messages/contacts/contacts.page.ts @@ -57,7 +57,7 @@ export class ContactsPage implements OnInit { }; this.chatService.getAllUsers().subscribe((res:any)=>{ console.log('All users',res.users); - this.contacts = res.users.filter(data => data.username != this.sessionStore.user.RochetChatUser); + this.contacts = res.users.filter(data => data.username != this.sessionStore.user.UserName); this.users = this.contacts.sort((a,b) => { if(a.name < b.name){ return -1; diff --git a/src/app/pages/chat/messages/messages.page.html b/src/app/pages/chat/messages/messages.page.html index 5298942f3..ada2c6f4c 100644 --- a/src/app/pages/chat/messages/messages.page.html +++ b/src/app/pages/chat/messages/messages.page.html @@ -61,7 +61,7 @@ {{msg.msg}} {{msg.msg}} - + @@ -74,7 +74,7 @@
-
+
{{msg.u.name}} {{msg.duration}} @@ -93,7 +93,7 @@
image - + @@ -150,7 +150,7 @@ - + diff --git a/src/app/pages/chat/messages/messages.page.ts b/src/app/pages/chat/messages/messages.page.ts index eae007500..bf3ef9c4b 100644 --- a/src/app/pages/chat/messages/messages.page.ts +++ b/src/app/pages/chat/messages/messages.page.ts @@ -536,7 +536,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { this.showLoader = true; this.chatService.getMembers(this.roomId).subscribe(res => { this.members = res['members']; - this.dmUsers = res['members'].filter(data => data.username != this.sessionStore.user.RochetChatUser) + this.dmUsers = res['members'].filter(data => data.username != this.sessionStore.user.UserName) this.showLoader = false; }); } diff --git a/src/app/pages/chat/new-group/new-group.page.ts b/src/app/pages/chat/new-group/new-group.page.ts index fb8bf8188..60dfcde6b 100644 --- a/src/app/pages/chat/new-group/new-group.page.ts +++ b/src/app/pages/chat/new-group/new-group.page.ts @@ -63,7 +63,7 @@ export class NewGroupPage implements OnInit { } async createGroup(){ - console.log('NEW GROUP', SessionStore.user.RochetChatUser) + console.log('NEW GROUP', SessionStore.user.UserName) let name = this.groupName.split(' ').join('-'); //Take out all special characters in string name = name.normalize("NFD").replace(/[\u0300-\u036f]/g, ""); @@ -75,11 +75,11 @@ export class NewGroupPage implements OnInit { let customFields = { "countDownDate":this.thedate } - res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.RochetChatUser, customFields); + res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.UserName, customFields); console.log(res); } else{ - res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.RochetChatUser, customFields); + res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.UserName, customFields); console.log(res); } diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index 4baeee66c..fbc2838c1 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -166,7 +166,7 @@ export class PublicationsPage implements OnInit { this.addActionToDB(folder) if (data.ActionType == "Evento") { - console.log('Evento', folder) + publicationsEventFolderList.push(folder); } else { diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index 7a8a6196d..7eba21f1f 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -128,7 +128,6 @@ export class AuthService { } session.Password = user.password - session.RochetChatUser = user.username.split('@')[0] session.BasicAuthKey = user.BasicAuthKey @@ -158,7 +157,7 @@ export class AuthService { let expirationDate = new Date(new Date().getTime() + expirationMinutes*60*1000); let postData = { - "user": SessionStore.user.RochetChatUser, + "user": SessionStore.user.UserName, "password": SessionStore.user.Password, } diff --git a/src/app/services/chat/message.service.ts b/src/app/services/chat/message.service.ts index 5b99ee3e0..f2d0d929f 100644 --- a/src/app/services/chat/message.service.ts +++ b/src/app/services/chat/message.service.ts @@ -171,7 +171,7 @@ export class MessageService { } else if(uploadSuccessfully == false) { this.errorUploadingAttachment = true - return new Promise((resolve, reject)=>{ + return new Promise((resolve, reject) => { reject(false) }) @@ -182,7 +182,7 @@ export class MessageService { } async sendRequest(params) { -console.log(params) + if(params?.attachments) { if(params?.attachments[0]?.image_url) { delete params?.attachments[0]?.image_url diff --git a/src/app/services/chat/ws-chat-methods.service.ts b/src/app/services/chat/ws-chat-methods.service.ts index d76119ee5..bc158569b 100644 --- a/src/app/services/chat/ws-chat-methods.service.ts +++ b/src/app/services/chat/ws-chat-methods.service.ts @@ -1,9 +1,9 @@ import { Injectable } from '@angular/core'; import { RoomService } from './room.service'; import { WsChatService } from 'src/app/services/chat/ws-chat.service'; -import { MessageService } from 'src/app/services/chat/message.service' +import { MessageService } from 'src/app/services/chat/message.service'; import { SessionStore } from 'src/app/store/session.service'; -import { capitalizeTxt } from 'src/plugin/text' +import { capitalizeTxt } from 'src/plugin/text'; import { Rooms, Update as room } from 'src/app/models/chatMethod'; import { Storage } from '@ionic/storage'; import { Platform } from '@ionic/angular'; @@ -16,12 +16,11 @@ import { NfService } from 'src/app/services/chat/nf.service' import { ChangeProfileService } from '../change-profile.service'; import { UserSession } from 'src/app/models/user.model'; import { AuthService } from '../auth.service'; -import { ChatStorageService } from './chat-storage.service' -import { ChatMethodsService } from './chat-methods.service' +import { ChatStorageService } from './chat-storage.service'; +import { ChatMethodsService } from './chat-methods.service'; import { AESEncrypt } from '../aesencrypt.service' import { AttachmentsService } from 'src/app/services/attachments.service'; import { NetworkServiceService} from 'src/app/services/network-service.service'; -import { ro } from 'date-fns/locale'; @Injectable({ providedIn: 'root' diff --git a/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.ts b/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.ts index 936ff49fb..20b692480 100644 --- a/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.ts +++ b/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.ts @@ -158,7 +158,7 @@ export class GroupContactsPage implements OnInit { this.contacts = res.users.filter(f => !this.members.some(item => item._id === f._id)); } else{ - this.contacts = res.users.filter(data => data.username != this.sessionStore.user.RochetChatUser); + this.contacts = res.users.filter(data => data.username != this.sessionStore.user.UserName); } this.users = this.contacts.sort((a,b) => { @@ -188,7 +188,7 @@ export class GroupContactsPage implements OnInit { this.contacts = res.users.filter(f => !this.members.some(item => item._id === f._id)); } else{ - this.contacts = res.users.filter(data => data.username != this.sessionStore.user.RochetChatUser); + this.contacts = res.users.filter(data => data.username != this.sessionStore.user.UserName); } this.users = this.contacts.sort((a,b) => { diff --git a/src/app/shared/chat/group-messages/group-messages.page.html b/src/app/shared/chat/group-messages/group-messages.page.html index 4f88af07d..e4d9424b9 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.html +++ b/src/app/shared/chat/group-messages/group-messages.page.html @@ -57,7 +57,7 @@ {{msg.msg}} {{msg.msg}} - + @@ -69,7 +69,7 @@
-
+
@@ -99,7 +99,7 @@ image - + @@ -147,7 +147,7 @@ - + diff --git a/src/app/shared/chat/messages/contacts/contacts.page.ts b/src/app/shared/chat/messages/contacts/contacts.page.ts index 92a8ed595..93e621ff3 100644 --- a/src/app/shared/chat/messages/contacts/contacts.page.ts +++ b/src/app/shared/chat/messages/contacts/contacts.page.ts @@ -73,8 +73,8 @@ export class ContactsPage implements OnInit { }; this.chatService.getAllUsers().subscribe((res:any)=>{ console.log(res.users); - //this.contacts = res.users.filter(data => data.username != this.sessionStore.user.RochetChatUser); - this.contacts = res.users.filter(data => data.username != this.sessionStore.user.RochetChatUser); + //this.contacts = res.users.filter(data => data.username != this.sessionStore.user.UserName); + this.contacts = res.users.filter(data => data.username != this.sessionStore.user.UserName); this.users = this.contacts.sort((a,b) => { if(a.name < b.name){ return -1; diff --git a/src/app/shared/chat/messages/messages.page.html b/src/app/shared/chat/messages/messages.page.html index 72921e6d9..9d60246ff 100644 --- a/src/app/shared/chat/messages/messages.page.html +++ b/src/app/shared/chat/messages/messages.page.html @@ -55,7 +55,8 @@ {{msg.msg}} Apagou a mensagem - + + @@ -67,7 +68,7 @@
-
@@ -93,7 +94,8 @@
image - + + @@ -148,7 +150,7 @@ - + diff --git a/src/app/shared/chat/messages/messages.page.ts b/src/app/shared/chat/messages/messages.page.ts index 6ba153488..b2c784b6e 100644 --- a/src/app/shared/chat/messages/messages.page.ts +++ b/src/app/shared/chat/messages/messages.page.ts @@ -545,7 +545,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy //this.showLoader = true; this.chatService.getMembers(this.roomId).subscribe(res => { this.members = res['members']; - this.dmUsers = res['members'].filter(data => data.username != this.sessionStore.user.RochetChatUser) + this.dmUsers = res['members'].filter(data => data.username != this.sessionStore.user.UserName) this.showLoader = false; }); } diff --git a/src/app/shared/chat/new-group/new-group.page.ts b/src/app/shared/chat/new-group/new-group.page.ts index 45b536e47..447fdd296 100644 --- a/src/app/shared/chat/new-group/new-group.page.ts +++ b/src/app/shared/chat/new-group/new-group.page.ts @@ -105,11 +105,11 @@ export class NewGroupPage implements OnInit{ let customFields = { "countDownDate":this.thedate } - res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.RochetChatUser, customFields); + res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.UserName, customFields); console.log(res); } else{ - res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.RochetChatUser, customFields); + res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.UserName, customFields); console.log(res); } diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 7e7f4b472..ee8e98126 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -21,12 +21,12 @@ export const environment = { production: false, - apiURL: 'https://gabinetedigital.dyndns.info/GabineteDigital.Services/V5/api/', - //apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V5/api/', - apiChatUrl: 'https://gabinetedigitalchat.dyndns.info/api/v1/', - apiWsChatUrl: 'wss://gabinetedigitalchat.dyndns.info/websocket', - //apiChatUrl: 'https://www.tabularium.pt/api/v1/', - //apiWsChatUrl: 'wss://www.tabularium.pt/websocket', + //apiURL: 'https://gabinetedigital.dyndns.info/GabineteDigital.Services/V5/api/', + apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V5/api/', + //apiChatUrl: 'https://gabinetedigitalchat.dyndns.info/api/v1/', + //apiWsChatUrl: 'wss://gabinetedigitalchat.dyndns.info/websocket', + apiChatUrl: 'https://www.tabularium.pt/api/v1/', + apiWsChatUrl: 'wss://www.tabularium.pt/websocket', domain: 'gabinetedigital.local', //gabinetedigital.local defaultuser: 'paulo.pinto@gabinetedigital.local',//paulo.pinto paulo.pinto@gabinetedigital.local defaultuserpwd: 'tabteste@006', //tabteste@006,