Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pleroma
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
Container registry
Model registry
Operate
Environments
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
jeff
pleroma
Commits
ce15e065
Commit
ce15e065
authored
6 years ago
by
rinpatch
Browse files
Options
Downloads
Patches
Plain Diff
Fix some edge cases [nervous laughter]
parent
4656f433
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/pleroma/user.ex
+14
-1
14 additions, 1 deletion
lib/pleroma/user.ex
lib/pleroma/web/metadata.ex
+8
-2
8 additions, 2 deletions
lib/pleroma/web/metadata.ex
lib/pleroma/web/router.ex
+1
-1
1 addition, 1 deletion
lib/pleroma/web/router.ex
with
23 additions
and
4 deletions
lib/pleroma/user.ex
+
14
−
1
View file @
ce15e065
...
...
@@ -454,7 +454,20 @@ defmodule Pleroma.User do
end
def
get_cached_by_nickname_or_id
(
nickname_or_id
)
do
get_cached_by_id
(
nickname_or_id
)
||
get_cached_by_nickname
(
nickname_or_id
)
try
do
# TODO: convert to UUIDs when !654 is merged
maybe_id
=
String
.
to_integer
(
nickname_or_id
)
user
=
get_cached_by_id
(
maybe_id
)
if
user
==
nil
do
raise
ArgumentError
,
message:
"invalid argument foo"
else
user
end
rescue
_
in
ArgumentError
->
get_cached_by_nickname
(
nickname_or_id
)
end
end
def
get_by_nickname
(
nickname
)
do
...
...
This diff is collapsed.
Click to expand it.
lib/pleroma/web/metadata.ex
+
8
−
2
View file @
ce15e065
...
...
@@ -21,7 +21,13 @@ defmodule Pleroma.Web.Metadata do
{
:meta
,
[
property:
"og:title"
,
content:
"
#{
user
.
name
}
(@
#{
user
.
nickname
}
@
#{
pleroma_domain
()
}
) post #
#{
activity
.
id
}
"
content:
"
#{
user
.
name
}
"
<>
if
user
.
local
do
"(@
#{
user
.
nickname
}
@{pleroma_domain})"
else
"(@
#{
user
.
nickname
}
)"
end
],
[]},
{
:meta
,
[
property:
"og:url"
,
content:
activity
.
data
[
"id"
]],
[]},
{
:meta
,
[
property:
"og:description"
,
content:
truncated_content
],
[]},
...
...
@@ -35,7 +41,7 @@ defmodule Pleroma.Web.Metadata do
# opengraph for user card
defp
opengraph_tags
(%{
user:
user
})
do
with
truncated_bio
=
scrub_html_and_truncate
(
user
.
bio
)
do
with
truncated_bio
=
scrub_html_and_truncate
(
user
.
bio
||
""
)
do
[
{
:meta
,
[
...
...
This diff is collapsed.
Click to expand it.
lib/pleroma/web/router.ex
+
1
−
1
View file @
ce15e065
...
...
@@ -505,7 +505,7 @@ defmodule Pleroma.Web.Router do
scope
"/"
,
Fallback
do
get
(
"/registration/:token"
,
RedirectController
,
:registration_page
)
get
(
"/*path"
,
RedirectController
,
:redirector
)
get
(
"/*path"
,
RedirectController
,
:redirector
_with_meta
)
options
(
"/*path"
,
RedirectController
,
:empty
)
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