Commit graph

89 commits

Author SHA1 Message Date
Matt Baer
849e5b8503
Merge pull request #330 from writeas/post-signatures
Support post signatures

Ref T582
2020-07-30 11:53:27 -04:00
Matt Baer
a25664bb97 Support post signatures
This enables users to add a signature to all blog posts, and update it from a single location.

Requires database migration with: writefreely db migrate

Closes T582
2020-06-23 16:24:45 -04:00
Matt Baer
9624c4db00 Show warning in editor when local draft is out of date
Fixes #41
2020-06-11 11:45:12 -04:00
Matt Baer
f9cd87ae3a Log handle on GetProfilePageFromHandle err 2020-03-19 13:43:07 -04:00
Matt Baer
ac522ed600 Reuse mention regex
This makes the app less error-prone by avoiding a regexp.MustCompile()
call in the ActivityObject() method, saves CPU work, and reuses code.
2020-03-17 13:43:25 -04:00
Matt Baer
97aec9c158 Fix error / info logging around AP mentions
This fixes log formatting and makes verbiage consistent & concise.
2020-03-17 13:42:51 -04:00
Matt Baer
a9bed9fea9 Prevent nil pointer panic from ActivityObject() method
Previously, we might potentially return a nil activitystreams.Object,
which would crash the app. This fixes that.
2020-03-17 13:14:29 -04:00
Matt Baer
563ea5b25b Fix image extraction for URLs with query strings
Previously, image extraction wouldn't catch images with a query string
(or anything else) appended. This fixes that by parsing extracted URLs
and only checking the path for what looks like an image file.
2020-02-19 17:07:02 -05:00
Matt Baer
34d196376e Include extracted images in draft social metadata
Previously, we didn't extract images for draft posts. This fixes that.
2020-02-19 16:38:50 -05:00
Matt Baer
7023b74d12 Update calls and vars for Invites and elsewhere
Ref T661
2020-02-09 11:24:48 -05:00
Matt Baer
468bbf2187 Merge branch 'develop' into rename-account-suspend 2020-02-09 11:14:14 -05:00
Matt Baer
bb63e64883 Clean up getProfilePageFromHandle
- Export the func
- Remove commented-out code
- Use log, not fmt for debug messages
- Remove named return parameters
- Use standard var naming schemes
- Fix spacing in queries and remove unnecessary chars
2020-02-08 12:10:47 -05:00
Matt Baer
68d63d3fef Merge branch 'develop' into activitypub-mentions 2020-02-08 11:51:18 -05:00
Matt Baer
1fd4230267
Merge pull request #248 from writeas/fix-drafts-html-entities
A minor Drafts page fix + improvement
2020-02-05 12:26:42 +01:00
Matt Baer
ff33c59f27
Merge pull request #180 from writeas/cache-control
Add Cache-Control headers on AP endpoints

Closes T693
2020-01-31 12:00:47 +01:00
Matt Baer
b336e95e12 Render HTML entities in Drafts list
Previously, we'd show the raw HTML entities in the summaries of Draft
posts, instead of rendering them. This fixes that.
2020-01-20 15:20:45 -05:00
Matt Baer
9958a1122b Show published date on post pages if Blog
Dates now display on blog post pages if the collection's chosen display
format is "Blog". It updates the chorus-collection-post template to now
respect this value (previously, it always showed the date).

Ref T669
2020-01-09 16:50:02 -05:00
Matt Baer
8dc1ef0fdb
Merge pull request #215 from writeas/prevent-fail-on-suspend-check
Prevent failed requests on failed user silence check
2019-12-17 21:12:58 -05:00
Matt Baer
6afafa4d67 Fix whitespace 2019-12-17 21:10:39 -05:00
Matt Baer
cfea887b78 Suppress "user not found" log when post not found
This also saves a user suspension check when a post isn't found.
2019-12-17 20:58:32 -05:00
Rob Loranger
4c0e4d04c1
404 for protected posts when previously authorized
a user who had previously authenticated on a protected collection would
still see the post after the owner was silenced, with a banner meant for
the owner displayed.
2019-12-17 10:42:31 -08:00
Matt Baer
a513c99a1e Merge branch 'hotfix-0.11.2' into activitypub-mentions 2019-11-27 18:20:04 -05:00
Matt Baer
d8df15855c Merge branch 'develop' into activitypub-mentions 2019-11-26 13:19:20 -05:00
Matt Baer
44a6703742 Prevent failed requests on failed user silence check 2019-11-26 13:14:52 -05:00
Matt Baer
c81927a69f Fix empty hostname when fetching AS post via ID
Previously, fetching ActivityStreams data about a post via
/api/posts/ID, instead of /api/collections/ALIAS/posts/SLUG wouldn't
include the instance's base URL. This fixes that.
2019-11-26 12:59:15 -05:00
Matt Baer
8d8e671a07 Fix suspension check in fetchPost()
Previously, this check would return a "user not found" error when
retrieving a collection post by its post ID, e.g. /api/posts/abc123
instead of /api/collections/demo/posts/my-slug -- this happens
particularly when `Announce`ing a post in the fediverse. This change
fixes that.
2019-11-19 09:59:13 +09:00
Matt Baer
2899d98cfd Fix collection post 500 when not logged in
This reverts some code from 5429ca4a, which broke collection post
loading on blog posts when not logged in.
2019-11-12 19:43:41 +09:00
Rob Loranger
7e014ca659
Rename Suspend status to Silence
This changes all variables and functions from using Suspend{ed} to using
Silence{d} as well as documentation, errors and logging.
2019-11-11 15:25:19 -08:00
Matt Baer
53586d9cb8 Merge branch 'develop' into T661-disable-accounts 2019-11-12 01:46:37 +09:00
Rob Loranger
f66d5bf1e8
use .Host instead of adding .Hostname 2019-11-09 11:41:39 -08:00
Rob Loranger
c0b75f6b65
pass hostname to canonical url in post templates
the change to take a hostname in Post.CanonicalURL broke a few template
using that function. This adds a Hostname string to the Post being
passed to templates and passes it to calls to Post.CanonicalURL
2019-11-08 08:47:03 -08:00
Matt Baer
e1149cd1e9 Fix URLs in CSV exports
This includes the instance's hostname in calls to export a CSV file and
PublicPost.CanonicalURL().

It also fixes a panic in that method during CSV export caused by draft
posts.
2019-11-07 17:25:42 +09:00
Rob Loranger
5429ca4ab0
add check for suspended user on single posts
also fix logic bug in posts.go viewCollectionPost checking the page
owner
2019-10-25 13:40:32 -07:00
Rob Loranger
f85f0751a3
address PR comments
- update error messages to be correct
- move suspended message into template and include for other pages
- check suspended status on all relevant pages and show message if
logged in user is suspended.
- fix possible nil pointer error
- remove changes to db schema files
- add version comment to migration
- add UserStatus type with UserActive and UserSuspended
- change database table to use status column instead of suspended
- update toggle suspended handler to be toggle status in prep for
possible future inclusion of further user statuses
2019-10-25 12:04:24 -07:00
Matt Baer
9873fc443f Merge branch 'develop' into T661-disable-accounts 2019-10-24 13:22:26 -04:00
Michael Demetriou
db14f04b59 Redirects from the intermediate page work and if there's an old mention
there it updates the table to include the handle.

migrations WIP
2019-10-10 16:04:43 +03:00
Michael Demetriou
99bb77153e Handles are saved in remoteusers while the links take you to an
intermediate page (WIP) that shows the user profile page url
2019-10-10 15:11:46 +03:00
Michael Demetriou
3eb638b14a Fix @thebaer's comments in dccfae7a61 (commitcomment-35410380) 2019-10-09 14:34:31 +03:00
Michael Demetriou
dccfae7a61 Mentioning pleroma accounts works! Mastodon still needs the type to b
be Note to work but I will open an issue for them and see what their
reaction will be.
2019-10-08 15:58:19 +03:00
Rob Loranger
f87371b594
update IsJSON to check for Accept header
this changes the helper IsJSON to take a request instead of a string,
allowing to check multiple headers. In this case both Content-Type and
Accept.
2019-09-18 12:39:53 -07:00
Matt Baer
40ffb3a5f9 Merge branch 'develop' into chorus 2019-09-10 21:41:28 +02:00
Matt Baer
b7acd39051 Add Cache-Control headers on AP endpoints
Includes:

* AP Collection fetching via canonical URL
* AP Collection fetching via API
* AP Post fetching via canonical URL
* AP Post fetching via API

Ref T693
2019-09-09 22:07:03 +02:00
Rob Loranger
77f7b4a522
Add account suspension features
This renders all requests for that user's posts, collections and related
ActivityPub endpoints with 404 responses.

While suspended, users may not create or edit posts or collections.

User status is listed in the admin user page

Admin view of user details shows status and now has a button to activate
or suspend a user.
2019-08-29 09:09:11 -07:00
Rob Loranger
f241d69425
reduce GetPinnedPosts calls to single line 2019-08-12 14:12:35 -07:00
Rob Loranger
b373aad298
prevent future posts from showing in pins
this changes GetPinnedPosts to accept an includeFutre bool, which
returns future dated pinned posts when true.
2019-08-12 09:58:30 -07:00
Matt Baer
deec914ccb Merge branch 'develop' into chorus 2019-08-08 07:55:49 -04:00
Matt Baer
adfcc82241
Merge pull request #148 from writeas/default-visibility
Support setting default blog visibility on instance

Resolves T675
2019-08-07 17:44:37 -04:00
Matt Baer
afadf6fdf6 Set default visibility in datastore.CreateCollection
instead of updating it later. This is more correct behavior, prevents an
additional query, and ensures that potential collection-creation when
claiming posts also respects the default (which it didn't before).

Ref T675
2019-08-07 16:20:32 -04:00
Matt Baer
3cc397ad76 Merge branch 'develop' into chorus 2019-08-07 10:58:34 -04:00
Matt Baer
ef4a5b20d1
Merge pull request #144 from writeas/fix-api-missing-hostname
Fix missing hostname when publishing via API
2019-08-07 10:40:45 -04:00