Display remote actor name in remote message view
This commit is contained in:
parent
d1fea9eb51
commit
6d55b8c5d7
4 changed files with 11 additions and 6 deletions
|
@ -42,7 +42,7 @@ import Vervis.Model
|
||||||
|
|
||||||
data MessageTreeNodeAuthor
|
data MessageTreeNodeAuthor
|
||||||
= MessageTreeNodeLocal LocalMessageId Sharer
|
= MessageTreeNodeLocal LocalMessageId Sharer
|
||||||
| MessageTreeNodeRemote Text LocalURI LocalURI
|
| MessageTreeNodeRemote Text LocalURI LocalURI (Maybe Text)
|
||||||
|
|
||||||
data MessageTreeNode = MessageTreeNode
|
data MessageTreeNode = MessageTreeNode
|
||||||
{ mtnMessageId :: MessageId
|
{ mtnMessageId :: MessageId
|
||||||
|
@ -69,13 +69,14 @@ getMessages getdid = runDB $ do
|
||||||
, i ^. InstanceHost
|
, i ^. InstanceHost
|
||||||
, rm ^. RemoteMessageIdent
|
, rm ^. RemoteMessageIdent
|
||||||
, rs ^. RemoteActorIdent
|
, rs ^. RemoteActorIdent
|
||||||
|
, rs ^. RemoteActorName
|
||||||
)
|
)
|
||||||
return $ map mklocal l ++ map mkremote r
|
return $ map mklocal l ++ map mkremote r
|
||||||
where
|
where
|
||||||
mklocal (Entity mid m, Value lmid, Entity _ s) =
|
mklocal (Entity mid m, Value lmid, Entity _ s) =
|
||||||
MessageTreeNode mid m $ MessageTreeNodeLocal lmid s
|
MessageTreeNode mid m $ MessageTreeNodeLocal lmid s
|
||||||
mkremote (Entity mid m, Value h, Value luMsg, Value luAuthor) =
|
mkremote (Entity mid m, Value h, Value luMsg, Value luAuthor, Value name) =
|
||||||
MessageTreeNode mid m $ MessageTreeNodeRemote h luMsg luAuthor
|
MessageTreeNode mid m $ MessageTreeNodeRemote h luMsg luAuthor name
|
||||||
|
|
||||||
discussionTree :: [MessageTreeNode] -> Forest MessageTreeNode
|
discussionTree :: [MessageTreeNode] -> Forest MessageTreeNode
|
||||||
discussionTree mss =
|
discussionTree mss =
|
||||||
|
|
|
@ -90,6 +90,7 @@ getNode getdid mid = do
|
||||||
(instanceHost i)
|
(instanceHost i)
|
||||||
(remoteMessageIdent rm)
|
(remoteMessageIdent rm)
|
||||||
(remoteActorIdent rs)
|
(remoteActorIdent rs)
|
||||||
|
(remoteActorName rs)
|
||||||
return $ MessageTreeNode mid m author
|
return $ MessageTreeNode mid m author
|
||||||
|
|
||||||
{-
|
{-
|
||||||
|
|
|
@ -18,7 +18,7 @@ $# <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||||
$of MessageTreeNodeLocal lmid s
|
$of MessageTreeNodeLocal lmid s
|
||||||
<a href=@{MessageR (sharerIdent s) (encodeHid lmid)}>
|
<a href=@{MessageR (sharerIdent s) (encodeHid lmid)}>
|
||||||
#{showTime $ messageCreated msg}
|
#{showTime $ messageCreated msg}
|
||||||
$of MessageTreeNodeRemote h luMsg _luAuthor
|
$of MessageTreeNodeRemote h luMsg _luAuthor _mname
|
||||||
<a href="#{renderFedURI $ l2f h luMsg}"}>
|
<a href="#{renderFedURI $ l2f h luMsg}"}>
|
||||||
#{showTime $ messageCreated msg}
|
#{showTime $ messageCreated msg}
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -21,8 +21,11 @@ $case actor
|
||||||
#{shr2text $ sharerIdent s}
|
#{shr2text $ sharerIdent s}
|
||||||
<span>
|
<span>
|
||||||
./s/#{shr2text $ sharerIdent s}
|
./s/#{shr2text $ sharerIdent s}
|
||||||
$of MessageTreeNodeRemote h _luMsg luAuthor
|
$of MessageTreeNodeRemote h _luMsg luAuthor mname
|
||||||
<a href="#{renderFedURI $ l2f h luAuthor}">
|
<a href="#{renderFedURI $ l2f h luAuthor}">
|
||||||
|
$maybe name <- mname
|
||||||
|
#{name}
|
||||||
|
$nothing
|
||||||
(?)
|
(?)
|
||||||
<span>
|
<span>
|
||||||
#{shortURI h luAuthor}
|
#{shortURI h luAuthor}
|
||||||
|
|
Loading…
Reference in a new issue