Update GetEvent + Invite endpoint to new Enveloped Http Log type
parent
e786bebeb2
commit
becd3bcdb1
|
@ -17,6 +17,7 @@ import Internal.Api.Request as R
|
||||||
import Internal.Config.Log exposing (log)
|
import Internal.Config.Log exposing (log)
|
||||||
import Internal.Tools.Json as Json
|
import Internal.Tools.Json as Json
|
||||||
import Internal.Tools.Timestamp as Timestamp
|
import Internal.Tools.Timestamp as Timestamp
|
||||||
|
import Internal.Values.Envelope as E
|
||||||
import Internal.Values.Event as Event exposing (Event)
|
import Internal.Values.Event as Event exposing (Event)
|
||||||
import Internal.Values.Room as Room
|
import Internal.Values.Room as Room
|
||||||
import Internal.Values.User as User
|
import Internal.Values.User as User
|
||||||
|
@ -82,7 +83,7 @@ getEventV1 { eventId, roomId } =
|
||||||
, path = [ "_matrix", "client", "r0", "rooms", roomId, "event", eventId ]
|
, path = [ "_matrix", "client", "r0", "rooms", roomId, "event", eventId ]
|
||||||
, toUpdate =
|
, toUpdate =
|
||||||
\event ->
|
\event ->
|
||||||
( V.MapRoom roomId (Room.AddEvent event)
|
( E.ContentUpdate <| V.MapRoom roomId (Room.AddEvent event)
|
||||||
, event.eventId
|
, event.eventId
|
||||||
|> (++) "Received event id "
|
|> (++) "Received event id "
|
||||||
|> log.debug
|
|> log.debug
|
||||||
|
@ -106,7 +107,7 @@ getEventV2 { eventId, roomId } =
|
||||||
, path = [ "_matrix", "client", "v3", "rooms", roomId, "event", eventId ]
|
, path = [ "_matrix", "client", "v3", "rooms", roomId, "event", eventId ]
|
||||||
, toUpdate =
|
, toUpdate =
|
||||||
\event ->
|
\event ->
|
||||||
( V.MapRoom roomId (Room.AddEvent event)
|
( E.ContentUpdate <| V.MapRoom roomId (Room.AddEvent event)
|
||||||
, event.eventId
|
, event.eventId
|
||||||
|> (++) "Received event id "
|
|> (++) "Received event id "
|
||||||
|> log.debug
|
|> log.debug
|
||||||
|
|
|
@ -22,6 +22,7 @@ import Internal.Api.Api as A
|
||||||
import Internal.Api.Request as R
|
import Internal.Api.Request as R
|
||||||
import Internal.Config.Log exposing (log)
|
import Internal.Config.Log exposing (log)
|
||||||
import Internal.Tools.Json as Json
|
import Internal.Tools.Json as Json
|
||||||
|
import Internal.Values.Envelope as E
|
||||||
import Internal.Values.Room as Room
|
import Internal.Values.Room as Room
|
||||||
import Internal.Values.User as User exposing (User)
|
import Internal.Values.User as User exposing (User)
|
||||||
import Internal.Values.Vault as V
|
import Internal.Values.Vault as V
|
||||||
|
@ -93,7 +94,7 @@ inviteV1 { roomId, user } =
|
||||||
, path = [ "_matrix", "client", "r0", "rooms", roomId, "invite" ]
|
, path = [ "_matrix", "client", "r0", "rooms", roomId, "invite" ]
|
||||||
, toUpdate =
|
, toUpdate =
|
||||||
always
|
always
|
||||||
( V.MapRoom roomId (Room.Invite user)
|
( E.ContentUpdate <| V.MapRoom roomId (Room.Invite user)
|
||||||
, String.concat
|
, String.concat
|
||||||
-- TODO: Move to Internal.Config.Text
|
-- TODO: Move to Internal.Config.Text
|
||||||
[ "Invited user "
|
[ "Invited user "
|
||||||
|
@ -123,7 +124,7 @@ inviteV2 { reason, roomId, user } =
|
||||||
, path = [ "_matrix", "client", "v3", "rooms", roomId, "invite" ]
|
, path = [ "_matrix", "client", "v3", "rooms", roomId, "invite" ]
|
||||||
, toUpdate =
|
, toUpdate =
|
||||||
always
|
always
|
||||||
( V.MapRoom roomId (Room.Invite user)
|
( E.ContentUpdate <| V.MapRoom roomId (Room.Invite user)
|
||||||
, String.concat
|
, String.concat
|
||||||
-- TODO: Move to Internal.Config.Text
|
-- TODO: Move to Internal.Config.Text
|
||||||
[ "Invited user "
|
[ "Invited user "
|
||||||
|
|
Loading…
Reference in New Issue