Skip to content

Commit

Permalink
fix stuff after rebasing
Browse files Browse the repository at this point in the history
  • Loading branch information
mheinzel committed Jun 23, 2020
1 parent 5ae87d5 commit f5979a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions services/galley/src/Galley/API/Mapping.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module Galley.API.Mapping where
import Control.Monad.Catch
import Data.Id (idToText)
import qualified Data.Id as Id
import Data.IdMapping (IdMapping (IdMapping, idMappingGlobal, idMappingLocal), MappedOrLocalId (Local, Mapped), opaqueIdFromMappedOrLocal)
import Data.IdMapping (IdMapping (IdMapping, _imMappedId, _imQualifiedId), MappedOrLocalId (Local, Mapped), opaqueIdFromMappedOrLocal)
import qualified Data.List as List
import Data.Qualified (renderQualifiedId)
import Galley.App
Expand Down Expand Up @@ -60,8 +60,8 @@ conversationView u Data.Conversation {..} = do
showUserId = \case
Local localId ->
idToText localId <> " (local)"
Mapped IdMapping {idMappingLocal, idMappingGlobal} ->
idToText idMappingLocal <> " (" <> renderQualifiedId idMappingGlobal <> ")"
Mapped IdMapping {_imMappedId, _imQualifiedId} ->
idToText _imMappedId <> " (" <> renderQualifiedId _imQualifiedId <> ")"
badState = Error status500 "bad-state" "Bad internal member state."

toMember :: Internal.Member -> Public.Member
Expand Down
5 changes: 2 additions & 3 deletions services/galley/src/Galley/API/Update.hs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ addMembers zusr zcon cid invite = do
mems <- botsAndUsers (Data.convMembers conv)
self <- getSelfMember zusr (snd mems)
ensureActionAllowed AddConversationMember self
invitedUsers <- traverse resolveOpaqueUserId (toList $ invUsers invite)
invitedUsers <- traverse IdMapping.resolveOpaqueUserId (toList $ invUsers invite)
toAdd <- fromMemberSize <$> checkedMemberAddSize invitedUsers
let newUsers = filter (notIsMember conv) (toList toAdd)
ensureMemberLimit (toList $ Data.convMembers conv) newUsers
Expand Down Expand Up @@ -530,13 +530,12 @@ removeMemberH (zusr ::: zcon ::: cid ::: victim) = do

removeMember :: UserId -> ConnId -> OpaqueConvId -> OpaqueUserId -> Galley UpdateResult
removeMember zusr zcon cid opaqueVictim = do
resolveOpaqueConvId cid >>= \case
IdMapping.resolveOpaqueConvId cid >>= \case
Mapped idMapping ->
-- FUTUREWORK(federation, #1274): forward request to conversation's backend.
throwM . federationNotImplemented $ pure idMapping
Local localConvId -> do
victim <- resolveOpaqueUserId opaqueVictim
victim <- IdMapping.resolveOpaqueUserId opaqueVictim
removeMemberOfLocalConversation localConvId victim
where
removeMemberOfLocalConversation convId victim = do
Expand Down

0 comments on commit f5979a3

Please sign in to comment.