File tree 1 file changed +15
-9
lines changed 1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -297,17 +297,23 @@ defmodule RetWeb.HubChannel do
297
297
account = Guardian.Phoenix.Socket . current_resource ( socket )
298
298
hub = socket |> hub_for_socket
299
299
300
- if ( type != "photo" and type != "video" ) or account |> can? ( spawn_camera ( hub ) ) do
301
- broadcast! (
302
- socket ,
303
- event ,
304
- payload
305
- |> Map . delete ( "session_id" )
306
- |> Map . put ( :session_id , socket . assigns . session_id )
307
- |> payload_with_from ( socket )
308
- )
300
+ if ( type == "photo" and type == "video" and
301
+ account
302
+ |> can? ( spawn_camera ( hub ) )
303
+ |> Kernel . not ( ) ) or
304
+ ( type == "permission" and hub |> Ret.Hub . is_owner? ( account . account_id ) |> Kernel . not ( ) ) do
305
+ { :noreply , socket }
309
306
end
310
307
308
+ broadcast! (
309
+ socket ,
310
+ event ,
311
+ payload
312
+ |> Map . delete ( "session_id" )
313
+ |> Map . put ( :session_id , socket . assigns . session_id )
314
+ |> payload_with_from ( socket )
315
+ )
316
+
311
317
{ :noreply , socket }
312
318
end
313
319
You can’t perform that action at this time.
0 commit comments