diff --git a/src/Vervis/Federation/Offer.hs b/src/Vervis/Federation/Offer.hs index 19a611e..7c8e3f0 100644 --- a/src/Vervis/Federation/Offer.hs +++ b/src/Vervis/Federation/Offer.hs @@ -241,15 +241,16 @@ followF case newItem of Nothing -> return $ Left "Activity already exists in inbox, not using" Just ractid -> do + let raidAuthor = remoteAuthorId author + ra <- getJust raidAuthor (obiid, doc) <- insertAcceptToOutbox + ra luFollow (recipOutbox recip) newFollow <- insertFollow ractid obiid $ recipFollowers recip if newFollow then Right <$> do - let raidAuthor = remoteAuthorId author - ra <- getJust raidAuthor let raInfo = (raidAuthor, remoteActorIdent ra, remoteActorInbox ra, remoteActorErrorSince ra) iidAuthor = remoteAuthorInstance author hAuthor = objUriAuthority $ remoteAuthorURI author @@ -285,9 +286,9 @@ followF mrfid <- insertUnique $ RemoteFollow raid fsid True (not hide) ractid obiidA return $ isJust mrfid - insertAcceptToOutbox luFollow obidRecip = do + insertAcceptToOutbox ra luFollow obidRecip = do now <- liftIO getCurrentTime - let uAuthor@(ObjURI hAuthor _) = remoteAuthorURI author + let uAuthor@(ObjURI hAuthor luAuthor) = remoteAuthorURI author encodeRouteLocal <- getEncodeRouteLocal hLocal <- asksSite siteInstanceHost let recipPath = localUriPath $ encodeRouteLocal recipRoute @@ -296,9 +297,12 @@ followF withUrlRenderer [hamlet|
-
- (?)
- 's follow request accepted by #
+
+ $maybe name <- remoteActorName ra
+ #{name}
+ $nothing
+ #{renderAuthority hAuthor}#{localUriPath luAuthor}
+ \'s follow request accepted by #
#{renderAuthority hLocal}#{recipPath}
.
diff --git a/src/Vervis/Federation/Ticket.hs b/src/Vervis/Federation/Ticket.hs
index eb2e353..f561428 100644
--- a/src/Vervis/Federation/Ticket.hs
+++ b/src/Vervis/Federation/Ticket.hs
@@ -171,7 +171,9 @@ projectOfferTicketF
(sid, jid, ibid, fsid{-, tids-}) <-
getProjectAndDeps shrRecip prjRecip {-deps-}
lift $ do
- mticket <- insertTicket luOffer jid ibid {-tids-}
+ mticket <- do
+ ra <- getJust $ remoteAuthorId author
+ insertTicket ra luOffer jid ibid {-tids-}
for mticket $ \ (ractid, num, obiidAccept, docAccept) -> do
msr <- for msig $ \ sig -> do
remoteRecips <- deliverLocal ractid colls sid fsid
@@ -219,7 +221,7 @@ projectOfferTicketF
| shr == shrRecip && prj == prjRecip
-> Just OfferTicketRecipProjectFollowers
_ -> Nothing
- insertTicket luOffer jid ibid {-deps-} = do
+ insertTicket ra luOffer jid ibid {-deps-} = do
let iidAuthor = remoteAuthorInstance author
raidAuthor = remoteAuthorId author
ractid <- either entityKey id <$> insertBy' RemoteActivity
@@ -240,7 +242,7 @@ projectOfferTicketF
updateGet jid [ProjectNextTicket +=. 1]
did <- insert Discussion
fsid <- insert FollowerSet
- (obiidAccept, docAccept) <- insertAccept luOffer next
+ (obiidAccept, docAccept) <- insertAccept ra luOffer next
tid <- insert Ticket
{ ticketProject = jid
, ticketNumber = next
@@ -291,7 +293,7 @@ projectOfferTicketF
delete ibiid
return remotes
- insertAccept luOffer num = do
+ insertAccept ra luOffer num = do
now <- liftIO getCurrentTime
(sid, project) <- do
sid <- fromJust <$> getKeyBy (UniqueSharer shrRecip)
@@ -300,17 +302,21 @@ projectOfferTicketF
insertToOutbox now $ projectOutbox project
where
insertToOutbox now obid = do
+ let uAuthor@(ObjURI hAuthor luAuthor) = remoteAuthorURI author
summary <-
TextHtml . TL.toStrict . renderHtml <$>
withUrlRenderer
[hamlet|
-
- (?)
- 's ticket accepted by project #
+
+ $maybe name <- remoteActorName ra
+ #{name}
+ $nothing
+ #{renderAuthority hAuthor}#{localUriPath luAuthor}
+ \'s ticket accepted by project #
./s/#{shr2text shrRecip}/p/#{prj2text prjRecip}
- : #
+ \: #
#{preEscapedToHtml $ unTextHtml $ AP.ticketSummary ticket}.
|]
diff --git a/src/Vervis/Widget/Sharer.hs b/src/Vervis/Widget/Sharer.hs
index 2453e90..e85e7bf 100644
--- a/src/Vervis/Widget/Sharer.hs
+++ b/src/Vervis/Widget/Sharer.hs
@@ -54,7 +54,7 @@ sharerLinkFedW (Right (inztance, actor)) =
$maybe name <- remoteActorName actor
#{name}
$nothing
- (?)
+ #{renderAuthority $ instanceHost inztance}#{localUriPath $ remoteActorIdent actor}
|]
where
uActor = ObjURI (instanceHost inztance) (remoteActorIdent actor)