Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mastodon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pierre Boudes
mastodon
Commits
c967802c
Commit
c967802c
authored
9 years ago
by
Eugen Rochko
Browse files
Options
Downloads
Patches
Plain Diff
Notify remote users about mentions
parent
79609d62
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/api/mastodon/entities.rb
+29
-2
29 additions, 2 deletions
app/api/mastodon/entities.rb
app/api/mastodon/rest.rb
+3
-3
3 additions, 3 deletions
app/api/mastodon/rest.rb
app/services/post_status_service.rb
+9
-0
9 additions, 0 deletions
app/services/post_status_service.rb
with
41 additions
and
5 deletions
app/api/mastodon/entities.rb
+
29
−
2
View file @
c967802c
module
Mastodon
module
Entities
class
Account
<
Grape
::
Entity
include
ApplicationHelper
expose
:id
expose
:username
expose
:domain
expose
:domain
do
|
account
|
account
.
local?
?
LOCAL_DOMAIN
:
account
.
domain
end
expose
:display_name
expose
:note
expose
:url
do
|
account
|
account
.
local?
?
profile_url
(
name:
account
.
username
)
:
account
.
url
end
end
class
Status
<
Grape
::
Entity
include
ApplicationHelper
format_with
(
:iso_timestamp
)
{
|
dt
|
dt
.
iso8601
}
expose
:uri
expose
:id
expose
:uri
do
|
status
|
status
.
local?
?
unique_tag
(
status
.
stream_entry
.
created_at
,
status
.
stream_entry
.
activity_id
,
status
.
stream_entry
.
activity_type
)
:
status
.
uri
end
expose
:url
do
|
status
|
status
.
local?
?
status_url
(
name:
status
.
account
.
username
,
id:
status
.
id
)
:
status
.
url
end
expose
:text
expose
:in_reply_to_id
expose
:reblog_of_id
expose
:reblog
,
using:
Mastodon
::
Entities
::
Status
expose
:account
,
using:
Mastodon
::
Entities
::
Account
with_options
(
format_with: :iso_timestamp
)
do
...
...
This diff is collapsed.
Click to expand it.
app/api/mastodon/rest.rb
+
3
−
3
View file @
c967802c
...
...
@@ -3,11 +3,11 @@ module Mastodon
version
'v1'
,
using: :path
format
:json
resource
:
status
es
do
resource
:
timelin
es
do
desc
'Return a public timeline'
get
:
all
do
present
Status
.
all
,
with:
Mastodon
::
Entities
::
Status
get
:
public
do
# todo
end
desc
'Return the home timeline of a logged in user'
...
...
This diff is collapsed.
Click to expand it.
app/services/post_status_service.rb
+
9
−
0
View file @
c967802c
...
...
@@ -9,6 +9,11 @@ class PostStatusService < BaseService
next
unless
local_account
.
nil?
follow_remote_account_service
.
(
"acct:
#{
match
.
first
}
"
)
end
status
.
mentions
.
each
do
|
mentioned_account
|
next
if
mentioned_account
.
local?
send_interaction_service
.
(
status
.
stream_entry
,
mentioned_account
)
end
end
private
...
...
@@ -16,4 +21,8 @@ class PostStatusService < BaseService
def
follow_remote_account_service
@follow_remote_account_service
||=
FollowRemoteAccountService
.
new
end
def
send_interaction_service
@send_interaction_service
||=
SendInteractionService
.
new
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment