package Ġuk . co . v ict oria jan ed avis . chat app . data . realtime Ċ Ċ import Ġandroid . util . Log Ċ import Ġio . reactivex . Flow able Ċ import Ġio . reactivex . dis pos ables . Disposable Ċ import Ġio . reactivex . schedul ers . Schedulers Ċ import Ġuk . co . v ict oria jan ed avis . chat app . data . map pers . Canceled Friend Request Ws Friend ship Db Mapper Ċ import Ġuk . co . v ict oria jan ed avis . chat app . data . model . db . Friend ship Db Model Ċ import Ġuk . co . v ict oria jan ed avis . chat app . data . realtime . fc m . Firebase Messaging Streams Ċ import Ġuk . co . v ict oria jan ed avis . chat app . data . realtime . websocket . WebSocket Streams Ċ import Ġuk . co . v ict oria jan ed avis . chat app . data . repositories . store . Received Friend Request Store Ċ import Ġuk . co . v ict oria jan ed avis . chat app . domain . Reactive Store Ċ import Ġjava . util . UUID Ċ import Ġjavax . inject . Inject Ċ import Ġjavax . inject . Named Ċ Ċ class ĠC anceled Friend Request Storage Binding Ġ@ Inject Ġconstructor ( ĊĠĠĠ Ġprivate Ġval Ġweb Socket Streams : ĠWebSocket Streams , ĊĠĠĠ Ġprivate Ġval Ġfirebase Messaging Streams : ĠFirebase Messaging Streams , ĊĠĠĠ Ġ@ Named ( Received Friend Request Store ) Ġprivate Ġval Ġfriend Store : ĠReactive Store < UUID , ĠFriend ship Db Model > Ċ ) Ġ{ ĊĠĠĠ Ġprivate Ġval Ġcanceled Friend Request Mapper Ġ= ĠC anceled Friend Request Ws Friend ship Db Mapper () ĊĊĠĠĠ Ġfun Ġsubscribe To Canceled Friend Requests Stream (): ĠDis posable Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠFlow able . merge ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġweb Socket Streams . c anceled Friend Request Stream (), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfirebase Messaging Streams . c anceled Friend Request Stream ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. do On Next Ġ{ ĠLog . d (" Canceled Friend Req ", Ġ" WebSocket ĠE mitted ") Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. publish (). auto Connect () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. map ( c anceled Friend Request Mapper :: map From ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. flatMap Comp letable ( friend Store :: store Sing ular ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. subscribe On ( Schedulers . io ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. subscribe () ĊĠĠĠ Ġ} Ċ }