Display remote actor name in remote message view

This commit is contained in:
fr33domlover 2019-05-21 09:11:13 +00:00
parent d1fea9eb51
commit 6d55b8c5d7
4 changed files with 11 additions and 6 deletions

View file

@ -42,7 +42,7 @@ import Vervis.Model
data MessageTreeNodeAuthor
= MessageTreeNodeLocal LocalMessageId Sharer
| MessageTreeNodeRemote Text LocalURI LocalURI
| MessageTreeNodeRemote Text LocalURI LocalURI (Maybe Text)
data MessageTreeNode = MessageTreeNode
{ mtnMessageId :: MessageId
@ -69,13 +69,14 @@ getMessages getdid = runDB $ do
, i ^. InstanceHost
, rm ^. RemoteMessageIdent
, rs ^. RemoteActorIdent
, rs ^. RemoteActorName
)
return $ map mklocal l ++ map mkremote r
where
mklocal (Entity mid m, Value lmid, Entity _ s) =
MessageTreeNode mid m $ MessageTreeNodeLocal lmid s
mkremote (Entity mid m, Value h, Value luMsg, Value luAuthor) =
MessageTreeNode mid m $ MessageTreeNodeRemote h luMsg luAuthor
mkremote (Entity mid m, Value h, Value luMsg, Value luAuthor, Value name) =
MessageTreeNode mid m $ MessageTreeNodeRemote h luMsg luAuthor name
discussionTree :: [MessageTreeNode] -> Forest MessageTreeNode
discussionTree mss =

View file

@ -90,6 +90,7 @@ getNode getdid mid = do
(instanceHost i)
(remoteMessageIdent rm)
(remoteActorIdent rs)
(remoteActorName rs)
return $ MessageTreeNode mid m author
{-

View file

@ -18,7 +18,7 @@ $# <http://creativecommons.org/publicdomain/zero/1.0/>.
$of MessageTreeNodeLocal lmid s
<a href=@{MessageR (sharerIdent s) (encodeHid lmid)}>
#{showTime $ messageCreated msg}
$of MessageTreeNodeRemote h luMsg _luAuthor
$of MessageTreeNodeRemote h luMsg _luAuthor _mname
<a href="#{renderFedURI $ l2f h luMsg}"}>
#{showTime $ messageCreated msg}
<div>

View file

@ -21,8 +21,11 @@ $case actor
#{shr2text $ sharerIdent s}
<span>
./s/#{shr2text $ sharerIdent s}
$of MessageTreeNodeRemote h _luMsg luAuthor
$of MessageTreeNodeRemote h _luMsg luAuthor mname
<a href="#{renderFedURI $ l2f h luAuthor}">
$maybe name <- mname
#{name}
$nothing
(?)
<span>
#{shortURI h luAuthor}