Просмотр исходного кода

darkirc: Attempt to mitigate double-message rendering.

parazyd 2 лет назад
Родитель
Сommit
5efa9427bb
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      bin/darkirc/src/irc/client.rs

+ 5 - 0
bin/darkirc/src/irc/client.rs

@@ -191,6 +191,11 @@ impl Client {
                         continue
                     }
 
+                    // If this event was seen, skip it
+                    if self.seen.get().unwrap().contains_key(event_id.as_bytes()).unwrap() {
+                        continue
+                    }
+
                     // Try to deserialize the `Event`'s content into a `Privmsg`
                     let mut privmsg: Privmsg = match deserialize_async_partial(r.content()).await {
                         Ok((v, _)) => v,