Explorar o código

Don't load conversation with own contact

Danilo Bargen %!s(int64=8) %!d(string=hai) anos
pai
achega
8132996edf
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      src/partials/messenger.ts

+ 7 - 0
src/partials/messenger.ts

@@ -244,6 +244,13 @@ class ConversationController {
         // Close any showing dialogs
         this.$mdDialog.cancel();
 
+        // Check if this is our own contact
+        if (this.webClientService.me.id === $stateParams.id) {
+            $log.warn('ConversationController: Cannot show own contact, redirecting to home');
+            $state.go('messenger.home');
+            return;
+        }
+
         this.maxTextLength = this.webClientService.getMaxTextLength();
 
         // On every navigation event, close all dialogs.