mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 05:45:50 +00:00
send and receive message
This commit is contained in:
@@ -4,15 +4,13 @@ import { Platform } from '@ionic/angular';
|
|||||||
import { StatusBar } from '@ionic-native/status-bar/ngx';
|
import { StatusBar } from '@ionic-native/status-bar/ngx';
|
||||||
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
|
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
|
||||||
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
||||||
import { InativityService } from "src/app/services/inativity.service";
|
|
||||||
import { ThemeService } from 'src/app/services/theme.service';
|
import { ThemeService } from 'src/app/services/theme.service';
|
||||||
import { environment } from 'src/environments/environment';
|
import { environment } from 'src/environments/environment';
|
||||||
import { Storage } from '@ionic/storage';
|
import { Storage } from '@ionic/storage';
|
||||||
import { ChatController } from './controller/chat';
|
|
||||||
import { register } from 'swiper/element/bundle';
|
import { register } from 'swiper/element/bundle';
|
||||||
import { DomSanitizer } from '@angular/platform-browser';
|
import { DomSanitizer } from '@angular/platform-browser';
|
||||||
import {ScreenOrientation} from "@ionic-native/screen-orientation/ngx";
|
import {ScreenOrientation} from "@ionic-native/screen-orientation/ngx";
|
||||||
|
import { ChatServiceService } from 'src/app/module/chat/chat-service.service'
|
||||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||||
parse: {
|
parse: {
|
||||||
dateInput: "YYYY-MMMM-DD HH:mm"
|
dateInput: "YYYY-MMMM-DD HH:mm"
|
||||||
@@ -41,7 +39,8 @@ export class AppComponent {
|
|||||||
public ThemeService: ThemeService,
|
public ThemeService: ThemeService,
|
||||||
private storage: Storage,
|
private storage: Storage,
|
||||||
private sanitizer: DomSanitizer,
|
private sanitizer: DomSanitizer,
|
||||||
private screenOrientation: ScreenOrientation
|
private screenOrientation: ScreenOrientation,
|
||||||
|
private ChatServiceService: ChatServiceService
|
||||||
) {
|
) {
|
||||||
|
|
||||||
window["sanitizer"] = this.sanitizer
|
window["sanitizer"] = this.sanitizer
|
||||||
|
|||||||
@@ -96,7 +96,6 @@ import { DeplomaOptionsPageModule } from './shared/popover/deploma-options/deplo
|
|||||||
import { DiplomaOptionsPage } from './shared/popover/deploma-options/deploma-options.page';
|
import { DiplomaOptionsPage } from './shared/popover/deploma-options/deploma-options.page';
|
||||||
import { ImageCropperModule } from 'ngx-image-cropper';
|
import { ImageCropperModule } from 'ngx-image-cropper';
|
||||||
import { createAction, createReducer, on, StoreModule } from '@ngrx/store';
|
import { createAction, createReducer, on, StoreModule } from '@ngrx/store';
|
||||||
import { chatReducer } from './services/Repositorys/chat/data-source/room/room-memory-data-source';
|
|
||||||
// import { ServiceWorkerModule } from '@angular/service-worker';
|
// import { ServiceWorkerModule } from '@angular/service-worker';
|
||||||
// import { AngularFireModule } from '@angular/fire';
|
// import { AngularFireModule } from '@angular/fire';
|
||||||
// import { AngularFireMessagingModule } from '@angular/fire/messaging';
|
// import { AngularFireMessagingModule } from '@angular/fire/messaging';
|
||||||
@@ -145,7 +144,6 @@ export function counterReducer(state, action) {
|
|||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [AppComponent, PopupQuestionPipe, InputFilterDirective],
|
declarations: [AppComponent, PopupQuestionPipe, InputFilterDirective],
|
||||||
imports: [BrowserModule,
|
imports: [BrowserModule,
|
||||||
StoreModule.forRoot({ count: counterReducer, chat: chatReducer }),
|
|
||||||
CommonModule,
|
CommonModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
CalendarModule.forRoot({
|
CalendarModule.forRoot({
|
||||||
|
|||||||
+229
-229
@@ -78,206 +78,206 @@ const routes: Routes = [
|
|||||||
],
|
],
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
path: 'agenda',
|
// path: 'agenda',
|
||||||
children: [
|
// children: [
|
||||||
{
|
// {
|
||||||
path:'',
|
// path:'',
|
||||||
loadChildren: () => AgendaPageModule
|
// loadChildren: () => AgendaPageModule
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path:':eventId/:caller',
|
// path:':eventId/:caller',
|
||||||
loadChildren: () => import('../pages/agenda/view-event/view-event.module').then( m => m.ViewEventPageModule),
|
// loadChildren: () => import('../pages/agenda/view-event/view-event.module').then( m => m.ViewEventPageModule),
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path: 'eventId/:caller',
|
// path: 'eventId/:caller',
|
||||||
loadChildren: () => import('../pages/agenda/view-event/view-event.module').then( m => m.ViewEventPageModule),
|
// loadChildren: () => import('../pages/agenda/view-event/view-event.module').then( m => m.ViewEventPageModule),
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path: 'edit-event',
|
// path: 'edit-event',
|
||||||
loadChildren: () => import('../pages/agenda/edit-event/edit-event.module').then( m => m.EditEventPageModule)
|
// loadChildren: () => import('../pages/agenda/edit-event/edit-event.module').then( m => m.EditEventPageModule)
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path: 'emend-message-modal',
|
// path: 'emend-message-modal',
|
||||||
loadChildren: () => import('../pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.module').then( m => m.ApproveEventModalPageModule)
|
// loadChildren: () => import('../pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.module').then( m => m.ApproveEventModalPageModule)
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path: 'view-event',
|
// path: 'view-event',
|
||||||
loadChildren: () => import('../pages/agenda/view-event/view-event.module').then( m => m.ViewEventPageModule)
|
// loadChildren: () => import('../pages/agenda/view-event/view-event.module').then( m => m.ViewEventPageModule)
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path:'event-list',
|
// path:'event-list',
|
||||||
children: [
|
// children: [
|
||||||
{
|
// {
|
||||||
path:'',
|
// path:'',
|
||||||
loadChildren: ()=> import('../pages/gabinete-digital/event-list/event-list.module').then(m => m.EventListPageModule)
|
// loadChildren: ()=> import('../pages/gabinete-digital/event-list/event-list.module').then(m => m.EventListPageModule)
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path:'approve-event',
|
// path:'approve-event',
|
||||||
children : [
|
// children : [
|
||||||
{
|
// {
|
||||||
path:':serialNumber/:caller',
|
// path:':serialNumber/:caller',
|
||||||
loadChildren: ()=> import('../pages/gabinete-digital/event-list/approve-event/approve-event.module').then(m => m.ApproveEventPageModule)
|
// loadChildren: ()=> import('../pages/gabinete-digital/event-list/approve-event/approve-event.module').then(m => m.ApproveEventPageModule)
|
||||||
},
|
// },
|
||||||
]
|
// ]
|
||||||
}
|
// }
|
||||||
]
|
// ]
|
||||||
},
|
// },
|
||||||
],
|
// ],
|
||||||
|
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path: 'gabinete-digital',
|
// path: 'gabinete-digital',
|
||||||
children: [
|
// children: [
|
||||||
{
|
// {
|
||||||
path:'',
|
// path:'',
|
||||||
loadChildren: ()=> GabineteDigitalPageModule
|
// loadChildren: ()=> GabineteDigitalPageModule
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path:'expediente',
|
// path:'expediente',
|
||||||
children: [
|
// children: [
|
||||||
{
|
// {
|
||||||
path:'',
|
// path:'',
|
||||||
loadChildren: ()=> import('../pages/gabinete-digital/expediente/expediente.module').then(m => m.ExpedientePageModule)
|
// loadChildren: ()=> import('../pages/gabinete-digital/expediente/expediente.module').then(m => m.ExpedientePageModule)
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path:':SerialNumber',
|
// path:':SerialNumber',
|
||||||
loadChildren: ()=> import('../pages/gabinete-digital/expediente/expediente-detail/expediente-detail.module').then(m => m.ExpedienteDetailPageModule)
|
// loadChildren: ()=> import('../pages/gabinete-digital/expediente/expediente-detail/expediente-detail.module').then(m => m.ExpedienteDetailPageModule)
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path:':SerialNumber/:caller',
|
// path:':SerialNumber/:caller',
|
||||||
loadChildren: ()=> import('../pages/gabinete-digital/expediente/expediente-detail/expediente-detail.module').then(m => m.ExpedienteDetailPageModule)
|
// loadChildren: ()=> import('../pages/gabinete-digital/expediente/expediente-detail/expediente-detail.module').then(m => m.ExpedienteDetailPageModule)
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path:'events/:eventId/:caller',
|
// path:'events/:eventId/:caller',
|
||||||
loadChildren: ()=> import('../pages/events/event-detail/event-detail.module').then(m => m.EventDetailPageModule),
|
// loadChildren: ()=> import('../pages/events/event-detail/event-detail.module').then(m => m.EventDetailPageModule),
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path:'expediente-task-modal',
|
// path:'expediente-task-modal',
|
||||||
loadChildren: ()=> import('../pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.module').then(m => m.ExpedientTaskModalPageModule),
|
// loadChildren: ()=> import('../pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.module').then(m => m.ExpedientTaskModalPageModule),
|
||||||
},
|
// },
|
||||||
]
|
// ]
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path: 'expedientes-pr',
|
// path: 'expedientes-pr',
|
||||||
children: [
|
// children: [
|
||||||
{
|
// {
|
||||||
path: '',
|
// path: '',
|
||||||
loadChildren: ()=> import('../pages/gabinete-digital/expedientes-pr/expedientes-pr.module').then(m => m.ExpedientesPrPageModule),
|
// loadChildren: ()=> import('../pages/gabinete-digital/expedientes-pr/expedientes-pr.module').then(m => m.ExpedientesPrPageModule),
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path:':SerialNumber/:caller',
|
// path:':SerialNumber/:caller',
|
||||||
loadChildren: ()=> import('../pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.module').then(m => m.ExpedientePrPageModule),
|
// loadChildren: ()=> import('../pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.module').then(m => m.ExpedientePrPageModule),
|
||||||
},
|
// },
|
||||||
]
|
// ]
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path: 'despachos',
|
// path: 'despachos',
|
||||||
children: [
|
// children: [
|
||||||
{
|
// {
|
||||||
path: '',
|
// path: '',
|
||||||
loadChildren: ()=> import('../pages/gabinete-digital/despachos/despachos.module').then(m => m.DespachosPageModule),
|
// loadChildren: ()=> import('../pages/gabinete-digital/despachos/despachos.module').then(m => m.DespachosPageModule),
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path:':SerialNumber/:caller',
|
// path:':SerialNumber/:caller',
|
||||||
loadChildren: ()=> import('../pages/gabinete-digital/despachos/despacho/despacho.module').then(m => m.DespachoPageModule),
|
// loadChildren: ()=> import('../pages/gabinete-digital/despachos/despacho/despacho.module').then(m => m.DespachoPageModule),
|
||||||
},
|
// },
|
||||||
]
|
// ]
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path: 'despachos-pr',
|
// path: 'despachos-pr',
|
||||||
children: [
|
// children: [
|
||||||
{
|
// {
|
||||||
path: '',
|
// path: '',
|
||||||
loadChildren: ()=> import('../pages/gabinete-digital/despachos-pr/despachos-pr.module').then(m => m.DespachosPrPageModule),
|
// loadChildren: ()=> import('../pages/gabinete-digital/despachos-pr/despachos-pr.module').then(m => m.DespachosPrPageModule),
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path:':SerialNumber/:caller',
|
// path:':SerialNumber/:caller',
|
||||||
loadChildren: ()=> import('../pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.module').then(m => m.DespachoPrPageModule),
|
// loadChildren: ()=> import('../pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.module').then(m => m.DespachoPrPageModule),
|
||||||
},
|
// },
|
||||||
]
|
// ]
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path: 'pedidos',
|
// path: 'pedidos',
|
||||||
children: [
|
// children: [
|
||||||
{
|
// {
|
||||||
path: '',
|
// path: '',
|
||||||
loadChildren: ()=> import('../pages/gabinete-digital/pedidos/pedidos.module').then(m => m.PedidosPageModule),
|
// loadChildren: ()=> import('../pages/gabinete-digital/pedidos/pedidos.module').then(m => m.PedidosPageModule),
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path:':SerialNumber/:caller',
|
// path:':SerialNumber/:caller',
|
||||||
loadChildren: ()=> import('../pages/gabinete-digital/pedidos/pedido/pedido.module').then(m => m.PedidoPageModule),
|
// loadChildren: ()=> import('../pages/gabinete-digital/pedidos/pedido/pedido.module').then(m => m.PedidoPageModule),
|
||||||
},
|
// },
|
||||||
]
|
// ]
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path: 'diplomas',
|
// path: 'diplomas',
|
||||||
children: [
|
// children: [
|
||||||
{
|
// {
|
||||||
path: '',
|
// path: '',
|
||||||
loadChildren: ()=> import('../pages/gabinete-digital/diplomas/diplomas.module').then(m => m.DiplomasPageModule),
|
// loadChildren: ()=> import('../pages/gabinete-digital/diplomas/diplomas.module').then(m => m.DiplomasPageModule),
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path:':SerialNumber/:caller',
|
// path:':SerialNumber/:caller',
|
||||||
loadChildren: ()=> import('../pages/gabinete-digital/diplomas/diploma/diploma.module').then(m => m.DiplomaPageModule),
|
// loadChildren: ()=> import('../pages/gabinete-digital/diplomas/diploma/diploma.module').then(m => m.DiplomaPageModule),
|
||||||
},
|
// },
|
||||||
]
|
// ]
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path: 'diplomas-assinar',
|
// path: 'diplomas-assinar',
|
||||||
children: [
|
// children: [
|
||||||
{
|
// {
|
||||||
path: '',
|
// path: '',
|
||||||
loadChildren: ()=> import('../pages/gabinete-digital/diplomas-assinar/diplomas-assinar.module').then(m => m.DiplomasAssinarPageModule),
|
// loadChildren: ()=> import('../pages/gabinete-digital/diplomas-assinar/diplomas-assinar.module').then(m => m.DiplomasAssinarPageModule),
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path:':SerialNumber/:caller',
|
// path:':SerialNumber/:caller',
|
||||||
loadChildren: ()=> import('../pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.module').then(m => m.DiplomaAssinarPageModule),
|
// loadChildren: ()=> import('../pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.module').then(m => m.DiplomaAssinarPageModule),
|
||||||
},
|
// },
|
||||||
]
|
// ]
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path: 'diplomas-gerar',
|
// path: 'diplomas-gerar',
|
||||||
children: [
|
// children: [
|
||||||
{
|
// {
|
||||||
path: '',
|
// path: '',
|
||||||
loadChildren: ()=> import('../pages/gabinete-digital/diplomas-gerar/diplomas-gerar.module').then(m => m.DiplomasGerarPageModule),
|
// loadChildren: ()=> import('../pages/gabinete-digital/diplomas-gerar/diplomas-gerar.module').then(m => m.DiplomasGerarPageModule),
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path:':SerialNumber/:caller',
|
// path:':SerialNumber/:caller',
|
||||||
loadChildren: ()=> import('../pages/gabinete-digital/diplomas-gerar/diplomas-gerar/diplomas-gerar-routing.module').then(m => m.DiplomasGerarPageRoutingModule),
|
// loadChildren: ()=> import('../pages/gabinete-digital/diplomas-gerar/diplomas-gerar/diplomas-gerar-routing.module').then(m => m.DiplomasGerarPageRoutingModule),
|
||||||
},
|
// },
|
||||||
]
|
// ]
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path:'event-list',
|
// path:'event-list',
|
||||||
children: [
|
// children: [
|
||||||
{
|
// {
|
||||||
path:'',
|
// path:'',
|
||||||
loadChildren: ()=> import('../pages/gabinete-digital/event-list/event-list.module').then(m => m.EventListPageModule)
|
// loadChildren: ()=> import('../pages/gabinete-digital/event-list/event-list.module').then(m => m.EventListPageModule)
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path:'approve-event',
|
// path:'approve-event',
|
||||||
children : [
|
// children : [
|
||||||
{
|
// {
|
||||||
path:':serialNumber/:caller',
|
// path:':serialNumber/:caller',
|
||||||
loadChildren: ()=> import('../pages/gabinete-digital/event-list/approve-event/approve-event.module').then(m => m.ApproveEventPageModule)
|
// loadChildren: ()=> import('../pages/gabinete-digital/event-list/approve-event/approve-event.module').then(m => m.ApproveEventPageModule)
|
||||||
},
|
// },
|
||||||
]
|
// ]
|
||||||
}
|
// }
|
||||||
]
|
// ]
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path: 'events-to-approve',
|
// path: 'events-to-approve',
|
||||||
children: [
|
// children: [
|
||||||
{
|
// {
|
||||||
path: '',
|
// path: '',
|
||||||
loadChildren: ()=> import('../shared/gabinete-digital/edit-event-to-approve/edit-event.module')
|
// loadChildren: ()=> import('../shared/gabinete-digital/edit-event-to-approve/edit-event.module')
|
||||||
}
|
// }
|
||||||
]
|
// ]
|
||||||
}
|
// }
|
||||||
],
|
// ],
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
path: 'search',
|
path: 'search',
|
||||||
children: [
|
children: [
|
||||||
@@ -288,37 +288,37 @@ const routes: Routes = [
|
|||||||
],
|
],
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
path: 'publications',
|
// path: 'publications',
|
||||||
children: [
|
// children: [
|
||||||
{
|
// {
|
||||||
path:'',
|
// path:'',
|
||||||
loadChildren: ()=> PublicationsPageModule
|
// loadChildren: ()=> PublicationsPageModule
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path:':folderId',
|
// path:':folderId',
|
||||||
loadChildren: ()=> import('../pages/publications/view-publications/view-publications.module').then(m => m.ViewPublicationsPageModule)
|
// loadChildren: ()=> import('../pages/publications/view-publications/view-publications.module').then(m => m.ViewPublicationsPageModule)
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path:'view-publications',
|
// path:'view-publications',
|
||||||
children: [
|
// children: [
|
||||||
{
|
// {
|
||||||
path:':folderId/:publicationId',
|
// path:':folderId/:publicationId',
|
||||||
loadChildren: ()=> import('../pages/publications/view-publications/publication-detail/publication-detail.module').then(m => m.PublicationDetailPageModule)
|
// loadChildren: ()=> import('../pages/publications/view-publications/publication-detail/publication-detail.module').then(m => m.PublicationDetailPageModule)
|
||||||
},
|
// },
|
||||||
]
|
// ]
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path:'new-publication',
|
// path:'new-publication',
|
||||||
loadChildren: ()=> import('../shared/publication/new-publication/new-publication.module').then(m => m.NewPublicationPageModule)
|
// loadChildren: ()=> import('../shared/publication/new-publication/new-publication.module').then(m => m.NewPublicationPageModule)
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path: 'request-options',
|
// path: 'request-options',
|
||||||
loadChildren: () => import('../shared/popover/request-options/request-options.module').then( m => m.RequestOptionsPageModule)
|
// loadChildren: () => import('../shared/popover/request-options/request-options.module').then( m => m.RequestOptionsPageModule)
|
||||||
},
|
// },
|
||||||
],
|
// ],
|
||||||
|
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
path: 'chat',
|
path: 'chat',
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { MessageAsyncService } from 'src/app/module/chat/data/async/socket/message-async.service'
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class ChatServiceService {
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private MessageAsyncService: MessageAsyncService
|
||||||
|
) { }
|
||||||
|
}
|
||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
import { TableRoom } from "../../data-source/room/rooom-local-data-source.service";
|
import { TableRoom } from "../../../data-source/room/rooom-local-data-source.service";
|
||||||
import { RoomListItemOutPutDTO, RoomListOutPutDTO } from "../../dto/room/roomListOutputDTO";
|
import { RoomListItemOutPutDTO, RoomListOutPutDTO } from "../../../dto/room/roomListOutputDTO";
|
||||||
|
|
||||||
export function roomListDetermineChanges(serverRooms: RoomListItemOutPutDTO[], localRooms: TableRoom[]) {
|
export function roomListDetermineChanges(serverRooms: RoomListItemOutPutDTO[], localRooms: TableRoom[]) {
|
||||||
const serverRoomMap = new Map(serverRooms.map(room => [room.id, room]));
|
const serverRoomMap = new Map(serverRooms.map(room => [room.id, room]));
|
||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
import { TableMemberList } from "../../data-source/room/rooom-local-data-source.service";
|
import { TableMemberList } from "../../../data-source/room/rooom-local-data-source.service";
|
||||||
import { RoomByIdMemberItemOutputDTO } from "../../dto/room/roomByIdOutputDTO";
|
import { RoomByIdMemberItemOutputDTO } from "../../../dto/room/roomByIdOutputDTO";
|
||||||
|
|
||||||
export function roomMemberListDetermineChanges(____serverRooms: RoomByIdMemberItemOutputDTO[], localRooms: TableMemberList[], roomId: string) {
|
export function roomMemberListDetermineChanges(____serverRooms: RoomByIdMemberItemOutputDTO[], localRooms: TableMemberList[], roomId: string) {
|
||||||
|
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { MessageLiveDataSourceService } from '../../data-source/message/message-live-data-source.service';
|
||||||
|
import { MessageLocalDataSourceService } from '../../data-source/message/message-local-data-source.service';
|
||||||
|
import { MessageRemoteDataSourceService } from '../../data-source/message/message-remote-data-source.service';
|
||||||
|
import { SignalRService } from '../../../infra/socket/signal-r.service';
|
||||||
|
import { filter } from 'rxjs/operators';
|
||||||
|
import { InstanceId } from '../../repository/message-respository.service';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class MessageAsyncService {
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private messageRemoteDataSourceService: MessageRemoteDataSourceService,
|
||||||
|
private messageLiveDataSourceService: MessageLiveDataSourceService,
|
||||||
|
private messageLiveSignalRDataSourceService: SignalRService,
|
||||||
|
private messageLocalDataSourceService: MessageLocalDataSourceService
|
||||||
|
) {
|
||||||
|
|
||||||
|
|
||||||
|
this.messageLiveSignalRDataSourceService.getMessage().pipe(
|
||||||
|
filter((message: any) => {
|
||||||
|
return !message?.requestId?.startsWith(InstanceId) && message?.requestId
|
||||||
|
})
|
||||||
|
).subscribe(async (message: any) => {
|
||||||
|
|
||||||
|
console.log('message async ', message)
|
||||||
|
const id = message.id
|
||||||
|
delete message.id;
|
||||||
|
|
||||||
|
// const result = await this.messageLocalDataSourceService.createMessage({
|
||||||
|
// messageId: id,
|
||||||
|
// sending: false,
|
||||||
|
// ...message
|
||||||
|
// })
|
||||||
|
|
||||||
|
// if(result.isOk()) {
|
||||||
|
|
||||||
|
// console.log(result.value)
|
||||||
|
|
||||||
|
// } else {
|
||||||
|
// console.log(result.error)
|
||||||
|
// }
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
+5
-2
@@ -1,12 +1,15 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { err, ok } from 'neverthrow';
|
import { err, ok } from 'neverthrow';
|
||||||
import { WebSocketMessage, WebSocketService } from '../../infra/socket/socket';
|
import { WebSocketMessage, WebSocketService } from '../../../infra/socket/socket';
|
||||||
|
import { SignalRService } from '../../../infra/socket/signal-r.service';
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class MessageLiveDataSourceService {
|
export class MessageLiveDataSourceService {
|
||||||
|
|
||||||
constructor(public socket: WebSocketService) {}
|
constructor(
|
||||||
|
public socket: WebSocketService,
|
||||||
|
private signalR: SignalRService) {}
|
||||||
|
|
||||||
async sendMessage(data: WebSocketMessage) {
|
async sendMessage(data: WebSocketMessage) {
|
||||||
|
|
||||||
+38
@@ -0,0 +1,38 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { err, ok } from 'neverthrow';
|
||||||
|
import { SignalRService } from '../../../infra/socket/signal-r.service';
|
||||||
|
|
||||||
|
|
||||||
|
interface msgObj {
|
||||||
|
roomId: string;
|
||||||
|
senderId: string;
|
||||||
|
message:string;
|
||||||
|
messageType:1;
|
||||||
|
canEdit:Boolean;
|
||||||
|
oneShot:Boolean;
|
||||||
|
requestId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class MessageLiveDataSourceService {
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private messageLiveSignalRDataSourceService: SignalRService
|
||||||
|
) {}
|
||||||
|
|
||||||
|
async sendMessage(data: msgObj) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
const result = await this.messageLiveSignalRDataSourceService.sendMessage(data)
|
||||||
|
|
||||||
|
return ok(result)
|
||||||
|
} catch (e) {
|
||||||
|
return err(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+1
-1
@@ -1,11 +1,11 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { HttpService } from 'src/app/services/http.service';
|
import { HttpService } from 'src/app/services/http.service';
|
||||||
import { DataSourceReturn } from '../../../type';
|
|
||||||
import { MessageInputDTO, MessageInputDTOSchema } from '../../dto/message/messageInputDtO';
|
import { MessageInputDTO, MessageInputDTOSchema } from '../../dto/message/messageInputDtO';
|
||||||
import { ValidateSchema } from 'src/app/services/decorators/validate-schema.decorator';
|
import { ValidateSchema } from 'src/app/services/decorators/validate-schema.decorator';
|
||||||
import { APIReturn } from 'src/app/services/decorators/api-validate-schema.decorator';
|
import { APIReturn } from 'src/app/services/decorators/api-validate-schema.decorator';
|
||||||
import { MessageOutPutDTO, MessageOutPutDTOSchema } from '../../dto/message/messageOutputDTO';
|
import { MessageOutPutDTO, MessageOutPutDTOSchema } from '../../dto/message/messageOutputDTO';
|
||||||
import { MessageListOutput } from '../../dto/message/messageListOutputDTO';
|
import { MessageListOutput } from '../../dto/message/messageListOutputDTO';
|
||||||
|
import { DataSourceReturn } from 'src/app/services/Repositorys/type';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { WebSocketMessage, WebSocketService } from '../../infra/socket/socket';
|
import { WebSocketMessage, WebSocketService } from '../../../infra/socket/socket';
|
||||||
import { err, ok } from 'neverthrow';
|
import { err, ok } from 'neverthrow';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
+1
-1
@@ -6,13 +6,13 @@ import { RoomInputDTO, RoomInputDTOSchema } from '../../dto/room/roomInputDTO';
|
|||||||
import { RoomOutPutDTO, RoomOutPutDTOSchema } from '../../dto/room/roomOutputDTO';
|
import { RoomOutPutDTO, RoomOutPutDTOSchema } from '../../dto/room/roomOutputDTO';
|
||||||
import { AddMemberToRoomInputDTO, AddMemberToRoomInputDTOSchema } from '../../dto/room/addMemberToRoomInputDto';
|
import { AddMemberToRoomInputDTO, AddMemberToRoomInputDTOSchema } from '../../dto/room/addMemberToRoomInputDto';
|
||||||
import { ValidateSchema } from 'src/app/services/decorators/validate-schema.decorator';
|
import { ValidateSchema } from 'src/app/services/decorators/validate-schema.decorator';
|
||||||
import { DataSourceReturn } from '../../../type';
|
|
||||||
import { RoomByIdInputDTO, RoomByIdInputDTOSchema } from '../../dto/room/roomByIdInputDTO';
|
import { RoomByIdInputDTO, RoomByIdInputDTOSchema } from '../../dto/room/roomByIdInputDTO';
|
||||||
import { RoomByIdOutputDTO, RoomByIdOutputDTOSchema } from '../../dto/room/roomByIdOutputDTO';
|
import { RoomByIdOutputDTO, RoomByIdOutputDTOSchema } from '../../dto/room/roomByIdOutputDTO';
|
||||||
import { APIReturn } from 'src/app/services/decorators/api-validate-schema.decorator';
|
import { APIReturn } from 'src/app/services/decorators/api-validate-schema.decorator';
|
||||||
import { UserRemoveListInputDTO, UserRemoveListInputDTOSchema } from '../../dto/room/userRemoveListInputDTO';
|
import { UserRemoveListInputDTO, UserRemoveListInputDTOSchema } from '../../dto/room/userRemoveListInputDTO';
|
||||||
import { RoomUpdateInputDTO, RoomUpdateInputDTOSchema } from '../../dto/room/roomUpdateInputDTO';
|
import { RoomUpdateInputDTO, RoomUpdateInputDTOSchema } from '../../dto/room/roomUpdateInputDTO';
|
||||||
import { RoomUpdateOutputDTO } from '../../dto/room/roomUpdateOutputDTO';
|
import { RoomUpdateOutputDTO } from '../../dto/room/roomUpdateOutputDTO';
|
||||||
|
import { DataSourceReturn } from 'src/app/services/Repositorys/type';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
+17
-25
@@ -4,6 +4,10 @@ import { MessageLiveDataSourceService } from '../data-source/message/message-liv
|
|||||||
import { MessageInputDTO } from '../dto/message/messageInputDtO';
|
import { MessageInputDTO } from '../dto/message/messageInputDtO';
|
||||||
import { MessageLocalDataSourceService, TableMessage } from '../data-source/message/message-local-data-source.service';
|
import { MessageLocalDataSourceService, TableMessage } from '../data-source/message/message-local-data-source.service';
|
||||||
import { SessionStore } from 'src/app/store/session.service';
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
|
import { SignalRService } from '../../infra/socket/signal-r.service';
|
||||||
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
|
|
||||||
|
export const InstanceId = uuidv4();
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -13,30 +17,11 @@ export class MessageRepositoryService {
|
|||||||
constructor(
|
constructor(
|
||||||
private messageRemoteDataSourceService: MessageRemoteDataSourceService,
|
private messageRemoteDataSourceService: MessageRemoteDataSourceService,
|
||||||
private messageLiveDataSourceService: MessageLiveDataSourceService,
|
private messageLiveDataSourceService: MessageLiveDataSourceService,
|
||||||
|
private messageLiveSignalRDataSourceService: SignalRService,
|
||||||
private messageLocalDataSourceService: MessageLocalDataSourceService
|
private messageLocalDataSourceService: MessageLocalDataSourceService
|
||||||
) {
|
) {
|
||||||
this.messageLiveDataSourceService.socket.messages$.subscribe(({payload, requestId, type}) => {
|
this.messageLiveDataSourceService.socket.messages$.subscribe(({payload, requestId, type}) => {
|
||||||
if(payload.sender == null) {
|
|
||||||
delete payload.sender
|
|
||||||
}
|
|
||||||
|
|
||||||
if(type == 'sendMessage') {
|
|
||||||
let clone: TableMessage = {
|
|
||||||
...payload,
|
|
||||||
messageId: payload.id,
|
|
||||||
}
|
|
||||||
|
|
||||||
delete clone.id
|
|
||||||
|
|
||||||
try {
|
|
||||||
this.messageLocalDataSourceService.createMessage(clone)
|
|
||||||
} catch (e) {
|
|
||||||
//console.log('error', {payload})
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (type == 'deleteMessage') {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -53,6 +38,8 @@ export class MessageRepositoryService {
|
|||||||
wxUserId: SessionStore.user.UserId
|
wxUserId: SessionStore.user.UserId
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data['requestId'] = InstanceId +'@'+ uuidv4();
|
||||||
|
|
||||||
const localActionResult = await this.messageLocalDataSourceService.sendMessage(data)
|
const localActionResult = await this.messageLocalDataSourceService.sendMessage(data)
|
||||||
|
|
||||||
this.messageLiveDataSourceService.sendMessage({
|
this.messageLiveDataSourceService.sendMessage({
|
||||||
@@ -61,17 +48,22 @@ export class MessageRepositoryService {
|
|||||||
})
|
})
|
||||||
|
|
||||||
if(localActionResult.isOk()) {
|
if(localActionResult.isOk()) {
|
||||||
const sendMessageResult = await this.messageRemoteDataSourceService.sendMessage(data)
|
|
||||||
|
const sendMessageResult = await this.messageLiveSignalRDataSourceService.sendMessage(data)
|
||||||
|
|
||||||
|
|
||||||
|
//const sendMessageResult = await this.messageRemoteDataSourceService.sendMessage(data)
|
||||||
|
|
||||||
if(sendMessageResult.isOk()) {
|
if(sendMessageResult.isOk()) {
|
||||||
|
|
||||||
if(sendMessageResult.value.data.sender == null) {
|
if(sendMessageResult.value.sender == undefined || sendMessageResult.value.sender == null) {
|
||||||
delete sendMessageResult.value.data.sender
|
console.log({sendMessageResult})
|
||||||
|
delete sendMessageResult.value.sender
|
||||||
}
|
}
|
||||||
|
|
||||||
let clone: TableMessage = {
|
let clone: TableMessage = {
|
||||||
...sendMessageResult.value.data,
|
...sendMessageResult.value,
|
||||||
messageId: sendMessageResult.value.data.id,
|
messageId: sendMessageResult.value.id,
|
||||||
id : localActionResult.value
|
id : localActionResult.value
|
||||||
}
|
}
|
||||||
|
|
||||||
+4
-7
@@ -1,20 +1,17 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { RoomRemoteDataSourceService } from '../data-source/room/room-remote-data-source.service'
|
import { RoomRemoteDataSourceService } from '../data-source/room/room-remote-data-source.service'
|
||||||
import { RoomInputDTO } from '../dto/room/roomInputDTO';
|
import { RoomInputDTO } from '../dto/room/roomInputDTO';
|
||||||
import { addRoom, RoomRemoteDataSourceState } from '../data-source/room/room-memory-data-source';
|
|
||||||
import { Store } from '@ngrx/store';
|
|
||||||
import { AddMemberToRoomInputDTO } from '../dto/room/addMemberToRoomInputDto';
|
import { AddMemberToRoomInputDTO } from '../dto/room/addMemberToRoomInputDto';
|
||||||
import { RoomLocalDataSourceService } from '../data-source/room/rooom-local-data-source.service';
|
import { RoomLocalDataSourceService } from '../data-source/room/rooom-local-data-source.service';
|
||||||
import { RoomByIdInputDTO } from '../dto/room/roomByIdInputDTO';
|
import { RoomByIdInputDTO } from '../dto/room/roomByIdInputDTO';
|
||||||
import { roomListDetermineChanges } from '../async/rooms/roomListChangeDetector';
|
import { roomListDetermineChanges } from '../async/list/rooms/roomListChangeDetector';
|
||||||
import { UserRemoveListInputDTO } from '../dto/room/userRemoveListInputDTO';
|
import { UserRemoveListInputDTO } from '../dto/room/userRemoveListInputDTO';
|
||||||
import { roomMemberListDetermineChanges } from '../async/rooms/roomMembersChangeDetector';
|
import { roomMemberListDetermineChanges } from '../async/list/rooms/roomMembersChangeDetector';
|
||||||
import { captureAndReraiseAsync } from 'src/app/services/decorators/captureAndReraiseAsync';
|
import { captureAndReraiseAsync } from 'src/app/services/decorators/captureAndReraiseAsync';
|
||||||
import { RoomUpdateInputDTO } from '../dto/room/roomUpdateInputDTO';
|
import { RoomUpdateInputDTO } from '../dto/room/roomUpdateInputDTO';
|
||||||
import { SessionStore } from 'src/app/store/session.service';
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
import { RoomLiveDataSourceService } from '../data-source/room/room-live-data-source.service';
|
import { RoomLiveDataSourceService } from '../data-source/room/room-live-data-source.service';
|
||||||
import { isHttpResponse } from 'src/app/services/http.service';
|
import { isHttpResponse } from 'src/app/services/http.service';
|
||||||
import { TableMessage } from '../data-source/message/message-local-data-source.service';
|
|
||||||
import { MessageLiveDataSourceService } from '../data-source/message/message-live-data-source.service';
|
import { MessageLiveDataSourceService } from '../data-source/message/message-live-data-source.service';
|
||||||
|
|
||||||
|
|
||||||
@@ -41,7 +38,7 @@ export class RoomRepositoryService {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private roomRemoteDataSourceService: RoomRemoteDataSourceService,
|
private roomRemoteDataSourceService: RoomRemoteDataSourceService,
|
||||||
private roomMemoryDataSourceService: Store<RoomRemoteDataSourceState>,
|
// private roomMemoryDataSourceService: Store<RoomRemoteDataSourceState>,
|
||||||
private roomLocalDataSourceService: RoomLocalDataSourceService,
|
private roomLocalDataSourceService: RoomLocalDataSourceService,
|
||||||
private roomLiveDataSourceService: RoomLiveDataSourceService,
|
private roomLiveDataSourceService: RoomLiveDataSourceService,
|
||||||
private messageLiveDataSourceService: MessageLiveDataSourceService,
|
private messageLiveDataSourceService: MessageLiveDataSourceService,
|
||||||
@@ -235,7 +232,7 @@ export class RoomRepositoryService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.roomMemoryDataSourceService.dispatch(addRoom(result.value))
|
// this.roomMemoryDataSourceService.dispatch(addRoom(result.value))
|
||||||
const localResult = await this.roomLocalDataSourceService.createRoom(result.value.data)
|
const localResult = await this.roomLocalDataSourceService.createRoom(result.value.data)
|
||||||
|
|
||||||
this.messageLiveDataSourceService.sendMessage({
|
this.messageLiveDataSourceService.sendMessage({
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { SignalRService } from './signal-r.service';
|
||||||
|
|
||||||
|
describe('SignalRService', () => {
|
||||||
|
let service: SignalRService;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
TestBed.configureTestingModule({});
|
||||||
|
service = TestBed.inject(SignalRService);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be created', () => {
|
||||||
|
expect(service).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { BehaviorSubject } from 'rxjs';
|
||||||
|
import { Platform } from '@ionic/angular';
|
||||||
|
import { SignalRConnection } from './signalR';
|
||||||
|
import { Plugins } from '@capacitor/core';
|
||||||
|
|
||||||
|
const { App } = Plugins;
|
||||||
|
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class SignalRService {
|
||||||
|
private connection: SignalRConnection;
|
||||||
|
private messageSubject: BehaviorSubject<string> = new BehaviorSubject<any>(null);
|
||||||
|
private connectingSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(null);
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private platform: Platform,) {
|
||||||
|
// this.startConnection();
|
||||||
|
// this.addMessageListener();
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (!this.platform.is('desktop')) {
|
||||||
|
App.addListener('appStateChange', ({ isActive }) => {
|
||||||
|
if (isActive) {
|
||||||
|
// The app is in the foreground.
|
||||||
|
console.log('App is in the foreground');
|
||||||
|
|
||||||
|
this.newConnection()
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// The app is in the background.
|
||||||
|
console.log('App is in the background');
|
||||||
|
// You can perform actions specific to the background state here.
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch(error) {}
|
||||||
|
|
||||||
|
this.establishConnection()
|
||||||
|
}
|
||||||
|
|
||||||
|
private async establishConnection() {
|
||||||
|
|
||||||
|
const connection = new SignalRConnection({url:'https://gdapi-dev.dyndns.info/stage/chathub'})
|
||||||
|
const attempConnection = await connection.establishConnection()
|
||||||
|
|
||||||
|
if(attempConnection.isOk()) {
|
||||||
|
|
||||||
|
this.connection?.closeConnection()
|
||||||
|
this.connection = connection
|
||||||
|
|
||||||
|
this.connection.getSendLater().subscribe(data => {
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
this.connection.getMessages().subscribe((data) => {
|
||||||
|
this.messageSubject.next(data)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getMessage() {
|
||||||
|
return this.messageSubject.asObservable()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async sendMessage(data: Object) {
|
||||||
|
return await this.connection.sendMessage(data as any)
|
||||||
|
}
|
||||||
|
|
||||||
|
newConnection() {
|
||||||
|
this.establishConnection()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,140 @@
|
|||||||
|
import * as signalR from '@microsoft/signalr';
|
||||||
|
import { BehaviorSubject, Observable } from 'rxjs';
|
||||||
|
import { ok, Result, err } from 'neverthrow';
|
||||||
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
|
import { filter, first } from 'rxjs/operators';
|
||||||
|
|
||||||
|
export class SignalRConnection {
|
||||||
|
|
||||||
|
private hubConnection: signalR.HubConnection;
|
||||||
|
private messageSubject: BehaviorSubject<string> = new BehaviorSubject<any>(null);
|
||||||
|
private connectionStateSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
|
||||||
|
private disconnectSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
|
||||||
|
private reconnectSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
|
||||||
|
private sendLaterSubject: BehaviorSubject<Object> = new BehaviorSubject<Object>(false);
|
||||||
|
private reconnect = true
|
||||||
|
url: string
|
||||||
|
|
||||||
|
constructor({url}) {
|
||||||
|
this.url = url
|
||||||
|
}
|
||||||
|
|
||||||
|
establishConnection(): Promise<Result<signalR.HubConnection, false>> {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
|
||||||
|
const hubConnection = new signalR.HubConnectionBuilder()
|
||||||
|
.withUrl(this.url)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
this.hubConnection = hubConnection
|
||||||
|
this.join()
|
||||||
|
|
||||||
|
hubConnection
|
||||||
|
.start()
|
||||||
|
.then(() => {
|
||||||
|
console.log('Connection started');
|
||||||
|
this.connectionStateSubject.next(true);
|
||||||
|
this.hubConnection = hubConnection
|
||||||
|
this.addMessageListener()
|
||||||
|
this.join()
|
||||||
|
resolve(ok(hubConnection))
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.log('Error while starting connection: ' + error);
|
||||||
|
this.connectionStateSubject.next(false);
|
||||||
|
reject(err(false))
|
||||||
|
});
|
||||||
|
|
||||||
|
hubConnection.onclose(() => {
|
||||||
|
console.log('Connection closed');
|
||||||
|
this.connectionStateSubject.next(false);
|
||||||
|
this.disconnectSubject.next(true)
|
||||||
|
if(this.reconnect) {
|
||||||
|
this.attempReconnect();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async attempReconnect() {
|
||||||
|
const attempConnection = await this.establishConnection()
|
||||||
|
|
||||||
|
if(attempConnection.isOk()) {
|
||||||
|
this.reconnectSubject.next(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public join() {
|
||||||
|
if(this.connectionStateSubject.value == true) {
|
||||||
|
console.log('join=============')
|
||||||
|
this.hubConnection.invoke("Join", 105, "UserFirefox");
|
||||||
|
} else {
|
||||||
|
this.sendLaterSubject.next({method: 'SendMessage', args:["Join", 312, "Daniel"]})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public async sendMessage(data: Object & { requestId}):Promise<Result<any, any>> {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
|
||||||
|
if(this.connectionStateSubject.value == true) {
|
||||||
|
console.log('sendMessage')
|
||||||
|
this.hubConnection.invoke("SendMessage", data)
|
||||||
|
|
||||||
|
this.messageSubject.pipe(
|
||||||
|
filter((message: any) => data.requestId == message?.requestId),
|
||||||
|
first()
|
||||||
|
).subscribe(value => {
|
||||||
|
resolve(ok(value))
|
||||||
|
console.log('Received valid value:', value);
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.sendLaterSubject.next({method: 'SendMessage', args: data})
|
||||||
|
return reject(err(false))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
private addMessageListener(): void {
|
||||||
|
this.hubConnection.on('ReceiveMessage', (message) => {
|
||||||
|
console.log('ReceiveMessage', message)
|
||||||
|
this.messageSubject.next(message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public getMessages(): Observable<string> {
|
||||||
|
return this.messageSubject.asObservable()
|
||||||
|
}
|
||||||
|
|
||||||
|
public getConnectionState(): Observable<boolean> {
|
||||||
|
return this.connectionStateSubject.asObservable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public getDisconnectTrigger(): Observable<boolean> {
|
||||||
|
return this.disconnectSubject.asObservable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public getSendLater() {
|
||||||
|
return this.sendLaterSubject.asObservable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public closeConnection(): void {
|
||||||
|
this.reconnect = false
|
||||||
|
if (this.hubConnection) {
|
||||||
|
this.hubConnection
|
||||||
|
.stop()
|
||||||
|
.then(() => {
|
||||||
|
console.log('Connection closed by user');
|
||||||
|
this.connectionStateSubject.next(false);
|
||||||
|
})
|
||||||
|
.catch(err => console.log('Error while closing connection: ' + err));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>SignalR Client</title>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/microsoft-signalr/8.0.0/signalr.min.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>SignalR Client</h1>
|
||||||
|
<div id="messages"></div>
|
||||||
|
<input id="chatbox">
|
||||||
|
<script>
|
||||||
|
var msgObj = {
|
||||||
|
roomId: "882fcb86-4028-4242-bb47-fca0170dcc65",
|
||||||
|
senderId:105,
|
||||||
|
message:"message enviada",
|
||||||
|
messageType:1,
|
||||||
|
canEdit:true,
|
||||||
|
oneShot:false,
|
||||||
|
};
|
||||||
|
|
||||||
|
const connection = new signalR.HubConnectionBuilder()
|
||||||
|
.withAutomaticReconnect()
|
||||||
|
.withUrl("https://gdapi-dev.dyndns.info/stage/chathub")
|
||||||
|
.build();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
connection.start().then(function () {
|
||||||
|
connection.invoke("Join", 105, "UserFirefox");
|
||||||
|
document.getElementById("chatbox").addEventListener("keyup", function (event) {
|
||||||
|
if (event.key === "Enter") {
|
||||||
|
msgObj.Message = chatbox.value;
|
||||||
|
connection.invoke("SendMessage", msgObj);
|
||||||
|
event.target.value = "";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}).catch(function (err) {
|
||||||
|
return console.error(err.toString());
|
||||||
|
});
|
||||||
|
|
||||||
|
connection.on("ReceiveMessage", function (message) {
|
||||||
|
console.log(message);
|
||||||
|
const messages = document.getElementById("messages");
|
||||||
|
messages.innerHTML += `<p>${message.message}</p>`;
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
<!-- Aside left -->
|
<!-- Aside left -->
|
||||||
<div class="aside-wrapper d-flex flex-column flex-grow-1">
|
<div class="aside-wrapper d-flex flex-column flex-grow-1">
|
||||||
<!-- <p class="text-center mt-0 aside-title px-20">Chat</p> -->
|
<!-- <p class="text-center mt-0 aside-title px-20">Chat</p> -->
|
||||||
<ion-progress-bar type="indeterminate" *ngIf="ChatSystemService.loadingWholeList"></ion-progress-bar>
|
<!-- <ion-progress-bar type="indeterminate" ></ion-progress-bar> -->
|
||||||
<div class="title-content">
|
<div class="title-content">
|
||||||
<div class="div-title">
|
<div class="div-title">
|
||||||
<ion-label class="title font-25-em">Chat</ion-label>
|
<ion-label class="title font-25-em">Chat</ion-label>
|
||||||
|
|||||||
@@ -24,18 +24,13 @@ import { environment } from 'src/environments/environment';
|
|||||||
import { TimeService } from 'src/app/services/functions/time.service';
|
import { TimeService } from 'src/app/services/functions/time.service';
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
import { DataService } from 'src/app/services/data.service';
|
import { DataService } from 'src/app/services/data.service';
|
||||||
import { StorageService } from 'src/app/services/storage.service';
|
|
||||||
import { SessionStore } from 'src/app/store/session.service';
|
|
||||||
import { ChatDebuggingPage } from 'src/app/shared/popover/chat-debugging/chat-debugging.page';
|
|
||||||
import { RouteService } from 'src/app/services/route.service';
|
import { RouteService } from 'src/app/services/route.service';
|
||||||
import { Plugins } from '@capacitor/core';
|
import { MessageLiveDataSourceService } from 'src/app/module/chat/data/data-source/message/message-live-data-source.service';
|
||||||
import { Store } from '@ngrx/store';
|
import { RoomRemoteDataSourceState } from 'src/app/module/chat/data/data-source/room/room-memory-data-source';
|
||||||
import { RoomRemoteDataSourceState } from 'src/app/services/Repositorys/chat/data-source/room/room-memory-data-source';
|
import { RoomListOutPutDTO } from 'src/app/module/chat/data/dto/room/roomListOutputDTO';
|
||||||
import { RoomRepositoryService } from 'src/app/services/Repositorys/chat/repository/room-repository.service'
|
import { MessageRepositoryService } from 'src/app/module/chat/data/repository/message-respository.service'
|
||||||
import { RoomListOutPutDTO } from 'src/app/services/Repositorys/chat/dto/room/roomListOutputDTO';
|
import { RoomRepositoryService } from 'src/app/module/chat/data/repository/room-repository.service'
|
||||||
import { Observable as DexieObservable } from 'Dexie';
|
import { Observable as DexieObservable } from 'Dexie';
|
||||||
import { MessageLiveDataSourceService } from 'src/app/services/Repositorys/chat/data-source/message/message-live-data-source.service';
|
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-chat',
|
selector: 'app-chat',
|
||||||
@@ -124,7 +119,6 @@ export class ChatPage implements OnInit {
|
|||||||
private router: Router,
|
private router: Router,
|
||||||
public ChatSystemService: ChatSystemService,
|
public ChatSystemService: ChatSystemService,
|
||||||
public RouteService: RouteService,
|
public RouteService: RouteService,
|
||||||
private store: Store<{ chat: RoomRemoteDataSourceState }>,
|
|
||||||
private RoomRepositoryService: RoomRepositoryService,
|
private RoomRepositoryService: RoomRepositoryService,
|
||||||
private messageLiveDataSourceService: MessageLiveDataSourceService,
|
private messageLiveDataSourceService: MessageLiveDataSourceService,
|
||||||
) {
|
) {
|
||||||
@@ -141,8 +135,6 @@ export class ChatPage implements OnInit {
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
this.count$ = store.select('chat');
|
|
||||||
|
|
||||||
this.headers = new HttpHeaders();
|
this.headers = new HttpHeaders();
|
||||||
window.onresize = (event) => {
|
window.onresize = (event) => {
|
||||||
if (window.innerWidth > 701) {
|
if (window.innerWidth > 701) {
|
||||||
|
|||||||
@@ -16,9 +16,7 @@ import { ViewEventPage } from 'src/app/modals/view-event/view-event.page';
|
|||||||
import { ChangeProfileService } from 'src/app/services/change-profile.service';
|
import { ChangeProfileService } from 'src/app/services/change-profile.service';
|
||||||
import { SessionStore } from 'src/app/store/session.service';
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
import { TaskService } from 'src/app/services/task.service';
|
import { TaskService } from 'src/app/services/task.service';
|
||||||
import { Store } from '@ngrx/store';
|
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { increment } from 'src/app/app.module';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-events',
|
selector: 'app-events',
|
||||||
@@ -95,16 +93,8 @@ export class EventsPage implements OnInit {
|
|||||||
public p: PermissionService,
|
public p: PermissionService,
|
||||||
private changeProfileService: ChangeProfileService,
|
private changeProfileService: ChangeProfileService,
|
||||||
public TaskService: TaskService,
|
public TaskService: TaskService,
|
||||||
private store: Store<{ count: number }>
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
this.count$ = store.select('count');
|
|
||||||
|
|
||||||
setInterval(() => {
|
|
||||||
this.store.dispatch(increment());
|
|
||||||
}, 5000)
|
|
||||||
|
|
||||||
|
|
||||||
window['zipPhoneCallback'] = function (zipphone) {
|
window['zipPhoneCallback'] = function (zipphone) {
|
||||||
var frame = document.getElementById('home-iframe');
|
var frame = document.getElementById('home-iframe');
|
||||||
if(frame) {
|
if(frame) {
|
||||||
|
|||||||
@@ -77,8 +77,6 @@ export class EventsPage implements OnInit {
|
|||||||
private router: Router,
|
private router: Router,
|
||||||
public activatedRoute: ActivatedRoute,
|
public activatedRoute: ActivatedRoute,
|
||||||
private processes:ProcessesService,
|
private processes:ProcessesService,
|
||||||
/* private gabineteService: GabineteDigitalPage, */
|
|
||||||
private modalController:ModalController,
|
|
||||||
private screenOrientation: ScreenOrientation,
|
private screenOrientation: ScreenOrientation,
|
||||||
public platform: Platform,
|
public platform: Platform,
|
||||||
public ThemeService: ThemeService,
|
public ThemeService: ThemeService,
|
||||||
|
|||||||
@@ -1,53 +1,53 @@
|
|||||||
import { DateTime } from 'luxon';
|
// import { DateTime } from 'luxon';
|
||||||
|
|
||||||
type GetDateWithFormatFormatInput = {
|
// type GetDateWithFormatFormatInput = {
|
||||||
date?: Date;
|
// date?: Date;
|
||||||
format?: string;
|
// format?: string;
|
||||||
};
|
// };
|
||||||
|
|
||||||
export class DateUtils {
|
// export class DateUtils {
|
||||||
static getDateStringWithFormat(
|
// static getDateStringWithFormat(
|
||||||
input: Partial<GetDateWithFormatFormatInput> = {},
|
// input: Partial<GetDateWithFormatFormatInput> = {},
|
||||||
): string {
|
// ): string {
|
||||||
if (!input?.date) {
|
// if (!input?.date) {
|
||||||
Object.assign(input, { date: DateUtils.getJSDate() });
|
// Object.assign(input, { date: DateUtils.getJSDate() });
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (!input?.format) {
|
// if (!input?.format) {
|
||||||
Object.assign(input, { format: process.env.DATE_FORMAT });
|
// Object.assign(input, { format: process.env.DATE_FORMAT });
|
||||||
}
|
// }
|
||||||
|
|
||||||
return DateTime.fromJSDate(input.date, { zone: 'utc' })
|
// return DateTime.fromJSDate(input.date, { zone: 'utc' })
|
||||||
.setZone(process.env.TZ)
|
// .setZone(process.env.TZ)
|
||||||
.toFormat(input.format);
|
// .toFormat(input.format);
|
||||||
}
|
// }
|
||||||
|
|
||||||
static getISODateString(): string {
|
// static getISODateString(): string {
|
||||||
return DateTime.fromJSDate(DateUtils.getJSDate(), { zone: 'utc' })
|
// return DateTime.fromJSDate(DateUtils.getJSDate(), { zone: 'utc' })
|
||||||
.setZone(process.env.TZ)
|
// .setZone(process.env.TZ)
|
||||||
.toJSON();
|
// .toJSON();
|
||||||
}
|
// }
|
||||||
|
|
||||||
static getISODateJSDateObject(dateObject: Date): string {
|
// static getISODateJSDateObject(dateObject: Date): string {
|
||||||
// Convert the JavaScript Date object to Luxon DateTime
|
// // Convert the JavaScript Date object to Luxon DateTime
|
||||||
const luxonDateTime = DateTime.fromJSDate(dateObject, { zone: 'utc' });
|
// const luxonDateTime = DateTime.fromJSDate(dateObject, { zone: 'utc' });
|
||||||
|
|
||||||
// Get the ISO 8601 formatted string in UTC
|
// // Get the ISO 8601 formatted string in UTC
|
||||||
const isoDateString = luxonDateTime.toISO();
|
// const isoDateString = luxonDateTime.toISO();
|
||||||
|
|
||||||
return isoDateString;
|
// return isoDateString;
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
static getJSDate(): Date {
|
// static getJSDate(): Date {
|
||||||
return DateTime.fromJSDate(DateTime.now().toJSDate(), { zone: 'utc' })
|
// return DateTime.fromJSDate(DateTime.now().toJSDate(), { zone: 'utc' })
|
||||||
.setZone(process.env.TZ)
|
// .setZone(process.env.TZ)
|
||||||
.toJSDate();
|
// .toJSDate();
|
||||||
}
|
// }
|
||||||
|
|
||||||
static getDate(): DateTime {
|
// static getDate(): DateTime {
|
||||||
return DateTime.fromJSDate(DateUtils.getJSDate(), { zone: 'utc' }).setZone(
|
// return DateTime.fromJSDate(DateUtils.getJSDate(), { zone: 'utc' }).setZone(
|
||||||
process.env.TZ,
|
// process.env.TZ,
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
|
// import { DateUtils } from './date';
|
||||||
|
|
||||||
import { DateUtils } from './date';
|
|
||||||
|
|
||||||
export type MessageType = {
|
export type MessageType = {
|
||||||
message: string;
|
message: string;
|
||||||
@@ -33,7 +31,7 @@ export class ColoredLoggerService {
|
|||||||
console.info(
|
console.info(
|
||||||
`[${getCurrentTime()}] %cINFO : `, // Console Message
|
`[${getCurrentTime()}] %cINFO : `, // Console Message
|
||||||
'color: #039BE5', // CSS Style
|
'color: #039BE5', // CSS Style
|
||||||
Object.assign(obj, { context, createdAt: DateUtils.getISODateString(), message })
|
Object.assign(obj, { context, createdAt: getCurrentTime(), message })
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,7 +39,7 @@ export class ColoredLoggerService {
|
|||||||
console.info(
|
console.info(
|
||||||
`[${getCurrentTime()}] %cINFO : `, // Console Message
|
`[${getCurrentTime()}] %cINFO : `, // Console Message
|
||||||
'color: #039BE5', // CSS Style
|
'color: #039BE5', // CSS Style
|
||||||
Object.assign(obj, { context, createdAt: DateUtils.getISODateString(), message })
|
Object.assign(obj, { context, createdAt: getCurrentTime(), message })
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,7 +47,7 @@ export class ColoredLoggerService {
|
|||||||
console.warn(
|
console.warn(
|
||||||
`[${getCurrentTime()}] %cWARN : `, // Console Message
|
`[${getCurrentTime()}] %cWARN : `, // Console Message
|
||||||
'color: #FB8C00', // CSS Style
|
'color: #FB8C00', // CSS Style
|
||||||
Object.assign(obj, { context, createdAt: DateUtils.getISODateString(), message })
|
Object.assign(obj, { context, createdAt: getCurrentTime(), message })
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { RoomRepositoryService } from '../Repositorys/chat/repository/room-repository.service';
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -7,6 +6,6 @@ import { RoomRepositoryService } from '../Repositorys/chat/repository/room-repos
|
|||||||
export class NewChatSystemService {
|
export class NewChatSystemService {
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private roomRepositoryService: RoomRepositoryService
|
|
||||||
) { }
|
) { }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,11 +4,13 @@ import { ModalController, PickerController } from '@ionic/angular';
|
|||||||
import { ChatService } from 'src/app/services/chat.service';
|
import { ChatService } from 'src/app/services/chat.service';
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
import { SessionStore } from 'src/app/store/session.service';
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
import { RoomRepositoryService } from 'src/app/services/Repositorys/chat/repository/room-repository.service'
|
|
||||||
import { HttpResponse } from '@microsoft/signalr';
|
import { HttpResponse } from '@microsoft/signalr';
|
||||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
import { ZodError } from 'zod';
|
import { ZodError } from 'zod';
|
||||||
|
import { RoomRepositoryService } from 'src/app/module/chat/data/repository/room-repository.service'
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-edit-group',
|
selector: 'app-edit-group',
|
||||||
templateUrl: './edit-group.page.html',
|
templateUrl: './edit-group.page.html',
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { ThemeService } from 'src/app/services/theme.service'
|
|||||||
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
|
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
|
||||||
import { ContactRepositoryService } from 'src/app/services/Repositorys/contacts/repository/contacts-repository.service';
|
import { ContactRepositoryService } from 'src/app/services/Repositorys/contacts/repository/contacts-repository.service';
|
||||||
import { UserContacts } from 'src/app/services/Repositorys/contacts/data-source/contacts-data-source.service';
|
import { UserContacts } from 'src/app/services/Repositorys/contacts/data-source/contacts-data-source.service';
|
||||||
import { RoomRepositoryService } from 'src/app/services/Repositorys/chat/repository/room-repository.service'
|
import { RoomRepositoryService } from 'src/app/module/chat/data/repository/room-repository.service'
|
||||||
|
|
||||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||||
import { SessionStore } from 'src/app/store/session.service';
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
import { HttpHeaders } from '@angular/common/http';
|
import { HttpHeaders } from '@angular/common/http';
|
||||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||||
import { ModalController } from '@ionic/angular';
|
import { ModalController } from '@ionic/angular';
|
||||||
import { ChatService } from 'src/app/services/chat.service';
|
|
||||||
import { MessagesPage } from '../messages.page';
|
import { MessagesPage } from '../messages.page';
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
import { ChatSystemService } from 'src/app/services/chat/chat-system.service'
|
import { ChatSystemService } from 'src/app/services/chat/chat-system.service'
|
||||||
import { SessionStore } from 'src/app/store/session.service';
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
import { ContactRepositoryService } from 'src/app/services/Repositorys/contacts/repository/contacts-repository.service';
|
import { ContactRepositoryService } from 'src/app/services/Repositorys/contacts/repository/contacts-repository.service';
|
||||||
import { UserContacts } from 'src/app/services/Repositorys/contacts/data-source/contacts-data-source.service';
|
import { UserContacts } from 'src/app/services/Repositorys/contacts/data-source/contacts-data-source.service';
|
||||||
import { RoomRepositoryService } from 'src/app/services/Repositorys/chat/repository/room-repository.service';
|
import { RoomRepositoryService } from 'src/app/module/chat/data/repository/room-repository.service'
|
||||||
import { HttpErrorResponse } from '@angular/common/http';
|
import { HttpErrorResponse } from '@angular/common/http';
|
||||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
|||||||
@@ -33,15 +33,16 @@ import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
|
|||||||
import { ChatMessageDebuggingPage } from 'src/app/shared/popover/chat-message-debugging/chat-message-debugging.page';
|
import { ChatMessageDebuggingPage } from 'src/app/shared/popover/chat-message-debugging/chat-message-debugging.page';
|
||||||
import { PermissionService } from 'src/app/services/permission.service';
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
import { FileValidatorService } from "src/app/services/file/file-validator.service"
|
import { FileValidatorService } from "src/app/services/file/file-validator.service"
|
||||||
import { RoomRepositoryService } from 'src/app/services/Repositorys/chat/repository/room-repository.service';
|
|
||||||
import { RoomListItemOutPutDTO } from 'src/app/services/Repositorys/chat/dto/room/roomListOutputDTO';
|
|
||||||
import { MessageRepositoryService } from 'src/app/services/Repositorys/chat/repository/message-respository.service';
|
|
||||||
import { MessageInputDTO } from 'src/app/services/Repositorys/chat/dto/message/messageInputDtO';
|
|
||||||
import { TableMemberList } from 'src/app/services/Repositorys/chat/data-source/room/rooom-local-data-source.service';
|
|
||||||
import { TableMessage } from 'src/app/services/Repositorys/chat/data-source/message/message-local-data-source.service';
|
|
||||||
import { ChatPopoverPage } from '../../popover/chat-popover/chat-popover.page';
|
import { ChatPopoverPage } from '../../popover/chat-popover/chat-popover.page';
|
||||||
import { Observable as DexieObservable } from 'Dexie';
|
import { Observable as DexieObservable } from 'Dexie';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
|
import { MessageRepositoryService } from 'src/app/module/chat/data/repository/message-respository.service'
|
||||||
|
import { RoomRepositoryService } from 'src/app/module/chat/data/repository/room-repository.service'
|
||||||
|
import { TableMessage } from 'src/app/module/chat/data/data-source/message/message-local-data-source.service';
|
||||||
|
import { TableMemberList } from 'src/app/module/chat/data/data-source/room/rooom-local-data-source.service';
|
||||||
|
import { MessageInputDTO } from 'src/app/module/chat/data/dto/message/messageInputDtO';
|
||||||
|
import { RoomListItemOutPutDTO } from 'src/app/module/chat/data/dto/room/roomListOutputDTO';
|
||||||
|
|
||||||
|
|
||||||
const IMAGE_DIR = 'stored-images';
|
const IMAGE_DIR = 'stored-images';
|
||||||
@Component({
|
@Component({
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { SessionStore } from 'src/app/store/session.service';
|
|||||||
import { ThemeService } from 'src/app/services/theme.service';
|
import { ThemeService } from 'src/app/services/theme.service';
|
||||||
import { RouteService } from 'src/app/services/route.service';
|
import { RouteService } from 'src/app/services/route.service';
|
||||||
import { HttpErrorResponse } from '@angular/common/http';
|
import { HttpErrorResponse } from '@angular/common/http';
|
||||||
import { RoomRepositoryService } from 'src/app/services/Repositorys/chat/repository/room-repository.service';
|
import { RoomRepositoryService } from 'src/app/module/chat/data/repository/room-repository.service'
|
||||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'
|
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
|||||||
@@ -4,14 +4,11 @@ import { ChatService } from 'src/app/services/chat.service';
|
|||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
import { SetRoomOwnerPage } from 'src/app/modals/set-room-owner/set-room-owner.page';
|
import { SetRoomOwnerPage } from 'src/app/modals/set-room-owner/set-room-owner.page';
|
||||||
import { RoomRepositoryService } from 'src/app/services/Repositorys/chat/repository/room-repository.service'
|
|
||||||
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
|
|
||||||
import { HttpErrorResponse, HttpResponse } from '@angular/common/http';
|
|
||||||
import { SessionStore } from 'src/app/store/session.service';
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
import { GroupContactsPage } from '../../chat/group-messages/group-contacts/group-contacts.page';
|
|
||||||
import { ZodError } from 'zod';
|
import { ZodError } from 'zod';
|
||||||
import { isHttpResponse } from 'src/app/services/http.service';
|
import { isHttpResponse } from 'src/app/services/http.service';
|
||||||
|
import { MessageRepositoryService } from 'src/app/module/chat/data/repository/message-respository.service'
|
||||||
|
import { RoomRepositoryService } from 'src/app/module/chat/data/repository/room-repository.service'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-chat-popover',
|
selector: 'app-chat-popover',
|
||||||
|
|||||||
Reference in New Issue
Block a user