summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Assistant.hs2
-rw-r--r--Assistant/Threads/WebApp.hs5
-rw-r--r--Command/WebApp.hs4
3 files changed, 8 insertions, 3 deletions
diff --git a/Assistant.hs b/Assistant.hs
index c091f5905..6da565b5e 100644
--- a/Assistant.hs
+++ b/Assistant.hs
@@ -197,7 +197,7 @@ startAssistant assistant daemonize webappwaiter = withThreadState $ \st -> do
mapM_ (startthread dstatus)
[ watch $ commitThread st changechan commitchan transferqueue dstatus
#ifdef WITH_WEBAPP
- , assist $ webAppThread (Just st) dstatus scanremotes transferqueue transferslots urlrenderer Nothing webappwaiter
+ , assist $ webAppThread (Just st) dstatus scanremotes transferqueue transferslots pushnotifier urlrenderer Nothing webappwaiter
#ifdef WITH_PAIRING
, assist $ pairListenerThread st dstatus scanremotes urlrenderer
#endif
diff --git a/Assistant/Threads/WebApp.hs b/Assistant/Threads/WebApp.hs
index 5eda88d36..7657fc7b8 100644
--- a/Assistant/Threads/WebApp.hs
+++ b/Assistant/Threads/WebApp.hs
@@ -32,6 +32,7 @@ import Assistant.DaemonStatus
import Assistant.ScanRemotes
import Assistant.TransferQueue
import Assistant.TransferSlots
+import Assistant.Pushes
import Utility.WebApp
import Utility.FileMode
import Utility.TempFile
@@ -55,17 +56,19 @@ webAppThread
-> ScanRemoteMap
-> TransferQueue
-> TransferSlots
+ -> PushNotifier
-> UrlRenderer
-> Maybe (IO String)
-> Maybe (Url -> FilePath -> IO ())
-> NamedThread
-webAppThread mst dstatus scanremotes transferqueue transferslots urlrenderer postfirstrun onstartup = thread $ do
+webAppThread mst dstatus scanremotes transferqueue transferslots pushnotifier urlrenderer postfirstrun onstartup = thread $ do
webapp <- WebApp
<$> pure mst
<*> pure dstatus
<*> pure scanremotes
<*> pure transferqueue
<*> pure transferslots
+ <*> pure pushnotifier
<*> (pack <$> genRandomToken)
<*> getreldir mst
<*> pure $(embed "static")
diff --git a/Command/WebApp.hs b/Command/WebApp.hs
index f87ea983a..99f94cd2f 100644
--- a/Command/WebApp.hs
+++ b/Command/WebApp.hs
@@ -15,6 +15,7 @@ import Assistant.DaemonStatus
import Assistant.ScanRemotes
import Assistant.TransferQueue
import Assistant.TransferSlots
+import Assistant.Pushes
import Assistant.Threads.WebApp
import Assistant.WebApp
import Assistant.Install
@@ -104,11 +105,12 @@ firstRun = do
transferqueue <- newTransferQueue
transferslots <- newTransferSlots
urlrenderer <- newUrlRenderer
+ pushnotifier <- newPushNotifier
v <- newEmptyMVar
let callback a = Just $ a v
void $ runNamedThread dstatus $
webAppThread Nothing dstatus scanremotes
- transferqueue transferslots urlrenderer
+ transferqueue transferslots pushnotifier urlrenderer
(callback signaler) (callback mainthread)
where
signaler v = do