Rename messageContent field to messageSource; content will soon be HTML

This commit is contained in:
fr33domlover 2019-06-02 12:04:35 +00:00
parent c7a563bd15
commit facf4d7f3e
5 changed files with 7 additions and 5 deletions

View file

@ -321,7 +321,7 @@ RemoteDiscussion
Message Message
created UTCTime created UTCTime
content Text -- Assume this is Pandoc Markdown source Text -- Pandoc Markdown
parent MessageId Maybe parent MessageId Maybe
root DiscussionId root DiscussionId

View file

@ -812,7 +812,7 @@ handleProjectInbox now shrRecip prjRecip iidSender hSender raidSender body raw a
} }
mid <- insert Message mid <- insert Message
{ messageCreated = published { messageCreated = published
, messageContent = content , messageSource = content
, messageParent = , messageParent =
case meparent of case meparent of
Just (Left midParent) -> Just midParent Just (Left midParent) -> Just midParent
@ -1327,7 +1327,7 @@ handleOutboxNote host (Note mluNote luAttrib aud muParent muContext mpublished c
now <- liftIO getCurrentTime now <- liftIO getCurrentTime
mid <- insert Message mid <- insert Message
{ messageCreated = now { messageCreated = now
, messageContent = content , messageSource = content
, messageParent = , messageParent =
case meparent of case meparent of
Just (Left midParent) -> Just midParent Just (Left midParent) -> Just midParent

View file

@ -164,7 +164,7 @@ getDiscussionMessage shr lmid = do
, noteReplyTo = Just $ fromMaybe uContext muParent , noteReplyTo = Just $ fromMaybe uContext muParent
, noteContext = Just uContext , noteContext = Just uContext
, notePublished = Just $ messageCreated m , notePublished = Just $ messageCreated m
, noteContent = messageContent m , noteContent = messageSource m
} }
selectRep $ do selectRep $ do
provideAP $ pure doc provideAP $ pure doc

View file

@ -486,6 +486,8 @@ changes hLocal ctx =
, renameEntity "ProjectAccess" "RoleAccess" , renameEntity "ProjectAccess" "RoleAccess"
-- 84 -- 84
, renameUnique "RoleAccess" "UniqueProjectAccess" "UniqueRoleAccess" , renameUnique "RoleAccess" "UniqueProjectAccess" "UniqueRoleAccess"
-- 85
, renameField "Message" "content" "source"
] ]
migrateDB :: MonadIO m => Text -> HashidsContext -> ReaderT SqlBackend m (Either Text (Int, Int)) migrateDB :: MonadIO m => Text -> HashidsContext -> ReaderT SqlBackend m (Either Text (Int, Int))

View file

@ -22,6 +22,6 @@ $# <http://creativecommons.org/publicdomain/zero/1.0/>.
<a href="#{renderFedURI $ l2f h luMsg}"}> <a href="#{renderFedURI $ l2f h luMsg}"}>
#{showTime $ messageCreated msg} #{showTime $ messageCreated msg}
<div> <div>
^{showContent $ messageContent msg} ^{showContent $ messageSource msg}
<div> <div>
<a href=@{reply msgid}>reply <a href=@{reply msgid}>reply