@@ -935,7 +935,7 @@ publishPost uId pc = commitedTransactionallyUpdate $ do
935 pId' <- manipulateParams createPostRowQ (uId, postCreationTags pc) >>= firstRow
935 pId' <- manipulateParams createPostRowQ (uId, postCreationTags pc) >>= firstRow
936 case pId' of
936 case pId' of
937 (Just (Only pId)) -> do
937 (Just (Only pId)) -> do
938− traversePrepared_ createPostElementRowsQ $ elementsToRows pId (postCreationBody pc)
938+ traversePrepared_ createPostElementRowsQ $ elementsToRows pId (map stripPostElement $ postCreationBody pc)
939 return pId
939 return pId
940 _ -> lift $ S.throwError S.err404
940 _ -> lift $ S.throwError S.err404
@@ -1043,14 +1043,14 @@ getMessagesInGroupChat selfId gId mId lim dir = do
1043 return . catMaybes . map restoreMessage $ resp
1043 return . catMaybes . map restoreMessage $ resp
1045sendMessage :: UserId -> MessageCreation -> StaticPQ MessageId
1045sendMessage :: UserId -> MessageCreation -> StaticPQ MessageId
1046−sendMessage selfId (MessageCreation (Just gId) uId@Nothing body) = do
1046+sendMessage selfId (MessageCreation (Just gId) uId@Nothing (Jsonb body)) = do
1047 _ <- getGroupChatForUser selfId gId
1047 _ <- getGroupChatForUser selfId gId
1048− (Only mId) <- manipulateParams createMessageQ (selfId, Just gId, uId, body)
1048+ (Only mId) <- manipulateParams createMessageQ (selfId, Just gId, uId, Jsonb $ stripPostElement body)
1049 >>= firstRow >>= fromMaybe500
1049 >>= firstRow >>= fromMaybe500
1050 return mId
1050 return mId
1051−sendMessage selfId (MessageCreation gId@Nothing (Just uId) body) = do
1051+sendMessage selfId (MessageCreation gId@Nothing (Just uId) (Jsonb body)) = do
1052 verifyUsers [uId]
1052 verifyUsers [uId]
1053− (Only mId) <- manipulateParams createMessageQ (selfId, gId, Just uId, body)
1053+ (Only mId) <- manipulateParams createMessageQ (selfId, gId, Just uId, Jsonb $ stripPostElement body)
1054 >>= firstRow >>= fromMaybe500
1054 >>= firstRow >>= fromMaybe500
1055 return mId
1055 return mId
1056sendMessage _ _ = lift $ S.throwError S.err400
1056sendMessage _ _ = lift $ S.throwError S.err400