Exemplo n.º 1
0
 public ContactListManager(IDependencyInjection dependencyInjection, ILoggerFactory loggerFactory, AppRepository appRepository, IFileService fileService, IChatEncryptionService chatEncryptionService, IDispatcher dispatcher, NotificationManager notificationManager, UnreadManager unreadManager)
 {
     this.logger                 = loggerFactory.CreateLogger <ContactListManager>();
     this._repo                  = appRepository;
     this._fileService           = fileService;
     this._chatEncryptionService = chatEncryptionService;
     this._dispatcher            = dispatcher;
     this._notificationManager   = notificationManager;
     this._unreadManager         = unreadManager;
     this.dependencyInjection    = dependencyInjection;
 }
Exemplo n.º 2
0
 public ChatWorker(ILoggerFactory loggerFactory, ICancellation cancellation, AppState appState, AppRepository appRepository, ITcpConnection tcpConnection, IUdpConnection udpConnection, IChatClient chatClient, IXDSSecService ixdsCryptoService, IChatEncryptionService chatEncryptionService, E2ERatchet e2eRatchet, ContactListManager contactListManager)
 {
     this.logger                = loggerFactory.CreateLogger <ChatWorker>();
     this.appState              = appState;
     this.repo                  = appRepository;
     this.tcp                   = tcpConnection;
     this.udp                   = udpConnection;
     this.chatClient            = chatClient;
     this.ixdsCryptoService     = ixdsCryptoService;
     this.chatEncryptionService = chatEncryptionService;
     this.e2eRatchet            = e2eRatchet;
     this.contactListManager    = contactListManager;
     this.cancellation          = cancellation;
     cancellation.RegisterWorker(this);
 }
Exemplo n.º 3
0
        public MessagesViewModel(IServiceProvider provider, string contactGuid, IChatView messageThreadView)
        {
            this._contactId         = contactGuid;
            this.logger             = provider.Get <ILoggerFactory>().CreateLogger <MessagesViewModel>();
            this._repo              = provider.Get <AppRepository>();
            this._messagesLoader    = new MessagesLoader(this._repo, contactGuid);
            this._messageThreadView = messageThreadView;

            this._encryptionService  = provider.Get <IChatEncryptionService>();
            this._unreadManager      = provider.Get <UnreadManager>();
            this._contactListManager = provider.Get <ContactListManager>();

            this._chatClient = provider.Get <IChatClient>();
            this._chatWorker = provider.Get <ChatWorker>();
            this._chatWorker.SendMessageStateUpdated  += (sender, message) => this._messageThreadView.UpdateSendMessageStateFromBackgroundThread(message);
            this._chatWorker.IncomingMessageDecrypted += async(sender, message) => await AddIncomingDecryptedMessageFromChatworker(message);
        }