diff --git a/src/app/models/beast-orm.ts b/src/app/models/beast-orm.ts index 49809e81f..b2a6b9b39 100644 --- a/src/app/models/beast-orm.ts +++ b/src/app/models/beast-orm.ts @@ -1,4 +1,4 @@ -import { models } from 'beast-orm' +import { models } from '../../plugin/beast-orm/dist/src/' import { AESEncrypt } from '../services/aesencrypt.service' const _AESEncrypt = new AESEncrypt() @@ -10,25 +10,25 @@ export class MessageModel extends models.Model { mentions = ArrayField() msg = models.CharField() rid = models.CharField() - ts = models.CharField() + ts = JsonField() u = JsonField() _id = models.CharField({unique:true}) - _updatedAt = models.CharField() + _updatedAt = models.IntegerField() messageSend = models.BooleanField() offline = models.BooleanField() viewed = ArrayField() received = ArrayField() localReference = models.CharField({blank:true}) - attachments = ArrayField() - file = ArrayField() + attachments = ArrayField({blank:true}) + file = JsonField({blank:true}) } export class DeleteMessageModel extends models.Model { - messageId = models.IntegerField() + messageId = models.CharField() rid = models.CharField() - ts = models.CharField() + ts = JsonField() u = JsonField() needToReceiveBy = ArrayField() diff --git a/src/app/services/chat/message.service.ts b/src/app/services/chat/message.service.ts index 838c0ea51..b1f3efee0 100644 --- a/src/app/services/chat/message.service.ts +++ b/src/app/services/chat/message.service.ts @@ -196,12 +196,7 @@ export class MessageService { type: 'reConnect', funx: async ()=> { - this.WsChatService.send(params).then(({message, requestId}) => { - let ChatMessage = message.result - this.messageSend = true - this.redefinedMessage(ChatMessage) - - }) + this.send() return true } }) diff --git a/src/app/services/chat/ws-chat.service.ts b/src/app/services/chat/ws-chat.service.ts index 75df35da7..bfb47a6d9 100644 --- a/src/app/services/chat/ws-chat.service.ts +++ b/src/app/services/chat/ws-chat.service.ts @@ -728,7 +728,7 @@ export class WsChatService { this.wsMsgQueue[requestId] = {message, requestId, loginRequired} } else { let messageStr = JSON.stringify(message) - console.log('messageStr', messageStr) + // console.log('messageStr', messageStr) this.socket.send(messageStr) } diff --git a/src/environments/environment.ts b/src/environments/environment.ts index b3c070ea0..2c9100ef6 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -3,31 +3,17 @@ // The list of file replacements can be found in `angular.json`. 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', - - //apiChatUrl: 'http://chat.gabinetedigital.local:3000/api/v1/', - + 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/', + /* apiChatUrl: 'http://chat.gabinetedigital.local:3000/api/v1/', */ domain: 'gabinetedigital.local', //gabinetedigital.local - defaultuser: 'paulo.pinto@gabinetedigital.local',//paulo.pinto paulo.pinto@gabinetedigital.local - defaultuserpwd: 'tabteste@006', //tabteste@006, - chatOffline: true - }; /*