diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 99f37e6..51bed30 100755 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -3,7 +3,7 @@ import { BrowserModule } from '@angular/platform-browser'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { ChatModule } from './pages/chat/chat.module'; -import { OmegleModule } from './shared/pool/omegle.module'; +import { OmegleModule } from './shared/omegle/omegle.module'; import { ErrorHandlingModule } from '@shared/error-handling/error-handling.module'; import { ToastrModule } from 'ngx-toastr'; import { AsyncModalModule } from '@belomonte/async-modal-ngx'; diff --git a/src/app/domain/user-status.enum.ts b/src/app/domain/user-status.enum.ts deleted file mode 100755 index 0f82bbc..0000000 --- a/src/app/domain/user-status.enum.ts +++ /dev/null @@ -1,4 +0,0 @@ -export enum UserStatus { - WANNA_CHAT = 'WANNA_CHAT', - OCCUPIED = 'OCCUPIED' -} diff --git a/src/app/pages/chat/chat.component.ts b/src/app/pages/chat/chat.component.ts index a544626..cd64aaf 100755 --- a/src/app/pages/chat/chat.component.ts +++ b/src/app/pages/chat/chat.component.ts @@ -45,7 +45,7 @@ export class ChatComponent implements OnDestroy, OnInit { constructor( private globalErrorHandler: GlobalErrorHandler, - private findStrangerProxy: FindStrangerService, + private findStrangerService: FindStrangerService, private talkToStrangerNostr: TalkToStrangerNostr, private soundNotificationService: SoundNotificationService, private modalService: ModalService @@ -81,9 +81,8 @@ export class ChatComponent implements OnDestroy, OnInit { this.whoDisconnected = null; this.currentState = this.stateSearchingStranger; this.messages = []; - this.findStrangerProxy.createSession(); - this.findStrangerProxy + this.findStrangerService .searchStranger({ signal: this.controller.signal, searchTags: [ 'omegle' ], @@ -101,12 +100,13 @@ export class ChatComponent implements OnDestroy, OnInit { }); } + // FIXME: preciso revisar este método, pois o endSession já é executado internamente na biblioteca quando se recebe um status de disconnected endSession(): Promise { this.subscriptions.unsubscribe(); this.subscriptions = new Subscription(); this.stranger = null; - return this.findStrangerProxy + return this.findStrangerService .endSession() .then(() => { this.currentState = ChatState.DISCONNECTED; diff --git a/src/app/shared/pool/omegle.module.ts b/src/app/shared/omegle/omegle.module.ts similarity index 100% rename from src/app/shared/pool/omegle.module.ts rename to src/app/shared/omegle/omegle.module.ts diff --git a/src/app/shared/pool/omegle.npool-opts.ts b/src/app/shared/omegle/omegle.npool-opts.ts similarity index 99% rename from src/app/shared/pool/omegle.npool-opts.ts rename to src/app/shared/omegle/omegle.npool-opts.ts index 4c522eb..db4803c 100755 --- a/src/app/shared/pool/omegle.npool-opts.ts +++ b/src/app/shared/omegle/omegle.npool-opts.ts @@ -8,7 +8,7 @@ export class OmegleNPoolOpts implements NPoolOpts { constructor( private relayConfigService: RelayConfigService ) { } - + open(url: string): NRelay1 { return new NRelay1(url); }