Pārlūkot izejas kodu

bin/darkirc: fix not replaying user's own messages when getting history

Dastan-glitch 3 gadi atpakaļ
vecāks
revīzija
51c251cc23
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  1. 4 0
      bin/darkirc/src/irc/server.rs

+ 4 - 0
bin/darkirc/src/irc/server.rs

@@ -92,6 +92,7 @@ impl IrcServer {
                 self.model.clone(),
                 self.model.clone(),
                 self.seen.clone(),
                 self.seen.clone(),
                 msg_recv,
                 msg_recv,
+                self.missed_events.clone(),
                 self.clients_subscriptions.clone(),
                 self.clients_subscriptions.clone(),
             ))
             ))
             .detach();
             .detach();
@@ -139,6 +140,7 @@ impl IrcServer {
         model: ModelPtr<PrivMsgEvent>,
         model: ModelPtr<PrivMsgEvent>,
         seen: SeenPtr<EventId>,
         seen: SeenPtr<EventId>,
         recv: smol::channel::Receiver<(NotifierMsg, u64)>,
         recv: smol::channel::Receiver<(NotifierMsg, u64)>,
+        missed_events: Arc<Mutex<Vec<Event<PrivMsgEvent>>>>,
         clients_subscriptions: SubscriberPtr<ClientSubMsg>,
         clients_subscriptions: SubscriberPtr<ClientSubMsg>,
     ) -> Result<()> {
     ) -> Result<()> {
         loop {
         loop {
@@ -177,6 +179,8 @@ impl IrcServer {
                         continue
                         continue
                     }
                     }
 
 
+                    missed_events.lock().await.push(event.clone());
+
                     p2p.broadcast(&event).await;
                     p2p.broadcast(&event).await;
                 }
                 }