Commit graph

59 commits

Author SHA1 Message Date
b13cf2fad4 Add support for Org Social v1.6
New features from Org Social v1.6:
- Add LOCATION, BIRTHDAY, LANGUAGE, PINNED fields to Profile model
- Support post ID in header (** 2025-05-01T12:00:00+0100)
- Header ID takes priority over property drawer ID
- Parse and store all new v1.6 metadata fields

Changes:
- Updated Profile model with 4 new fields
- Updated parser to extract new metadata fields
- Updated parser to support ID in post headers
- Updated tasks.py to save new profile fields
- Added database migration 0010
- Added 3 new tests for v1.6 features
- Renamed SKILL.md to CLAUDE.MD

All tests passing (58/58)
2026-01-05 13:55:56 +01:00
dc4813c5fc Fix RSS feed chronological order
Parse post_id timestamp for created_at instead of using database insertion time
2025-12-25 11:10:06 +01:00
Andros Fenollosa
94d856a704 Detect and remove deleted posts during feed scanning 2025-12-11 17:04:05 +01:00
Andros Fenollosa
8ca15ffab9 Fix SSE heartbeat blocking issue
The SSE endpoint was using pubsub.listen() which blocks indefinitely
waiting for messages. This prevented heartbeats from being sent when
there was no activity, causing connections to timeout and close.

Changed to use pubsub.get_message(timeout=1) in a while loop, which
allows heartbeats to be sent every 30 seconds even when there are no
new notifications, keeping connections alive.

This fixes the issue where SSE connections would break and users
wouldn't receive real-time notifications.
2025-12-11 16:41:25 +01:00
Andros Fenollosa
9ccd326bea Realtime notification had been added 2025-12-05 09:13:52 +01:00
Andros Fenollosa
7c60f060c8 Added feed content 2025-11-30 17:03:53 +01:00
Andros Fenollosa
75460aa567 fix: Handle Follow relationship constraints during redirect merge
When merging duplicate feeds with redirects, Follow relationships
can generate UNIQUE constraint errors if the relationship already
exists between the same profiles.

This fix:
- Iterates Follow relationships individually
- Checks for existing relationships before updating
- Deletes duplicates safely
- Adds comprehensive error handling

Similar approach to PollVote fix.

Resolves issue with feeds like haiverin.scot redirect.

Signed-off-by: Andros Fenollosa <hi@andros.dev>
2025-11-23 10:58:04 +01:00
Andros Fenollosa
b8c3d98b5d Fixed redirects 2025-11-23 10:53:31 +01:00
Andros Fenollosa
0300a728d2 Refactor 2025-11-17 08:14:26 +01:00
Andros Fenollosa
0873f18c00 Added interactions 2025-11-17 08:07:07 +01:00
Andros Fenollosa
aa5f200fb5 Added boosts 2025-11-16 18:41:45 +01:00
Andros Fenollosa
f09863d6a9 RSS: Added cache system 2025-11-16 09:42:06 +01:00
Andros Fenollosa
84ae9dffcc Posts with empty content was being ignored when fetching RSS feeds. 2025-11-16 09:28:50 +01:00
Andros Fenollosa
fd26468843 Fixed headers 2025-11-16 09:15:50 +01:00
Andros Fenollosa
cc3a270d76 Removed limit 2025-11-15 10:19:28 +01:00
Andros Fenollosa
79ff3a63a5 Added RSS feature 2025-11-15 10:12:46 +01:00
Andros Fenollosa
2f6c7f302c New encoder 2025-11-13 18:20:22 +01:00
Andros Fenollosa
5df132349c Added render 2025-11-13 17:36:55 +01:00
Andros Fenollosa
2491ff9f2a Fix: encode Emoji 2025-11-13 17:31:59 +01:00
Andros Fenollosa
7128200dd8 Middleware cache had been added 2025-11-05 15:27:04 +01:00
Andros Fenollosa
551651afd9 Added etag and mod header 2025-11-05 15:03:20 +01:00
Andros Fenollosa
d2014085f0 Fix parent 2025-11-05 09:37:07 +01:00
Andros Fenollosa
7e0cb6330b Added https://github.com/tanrax/org-social-relay/issues/3 2025-11-05 09:05:50 +01:00
Andros Fenollosa
48f1e32f00 Optional title was added 2025-11-04 15:16:53 +01:00
Andros Fenollosa
23d3e6dfe8 Fixed reaction 2025-11-01 14:42:43 +01:00
Andros Fenollosa
4e0949112e Add notification endpoints to root view 2025-10-11 11:21:08 +02:00
Andros Fenollosa
390561fffe Add automatic cleanup of stale feeds
This commit implements automatic cleanup of feeds that haven't been successfully fetched in 3 days.

Changes:
- Add last_successful_fetch field to Feed model to track when feeds are successfully fetched (HTTP 200)
- Update parse_org_social() and validate_org_social_feed() to record successful fetches
- Add new periodic task cleanup_stale_feeds() that runs every 3 days and deletes inactive feeds
- Add comprehensive test suite (9 tests, all passing)
- Migration safely handles existing feeds by setting initial last_successful_fetch to protect them

Safety features:
- Feeds with last_successful_fetch = NULL are never deleted (protects legacy feeds)
- Only feeds older than 3 days are deleted
- Extensive logging of cleanup operations
- Initial migration sets timestamp for all existing feeds to prevent accidental deletion

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2025-10-11 10:53:29 +02:00
Andros Fenollosa
388ed52285 Add new notification endpoints: reactions, replies-to, and notifications
This commit introduces three new REST API endpoints to the Org Social Relay:

1. /reactions/ - Retrieves reactions (posts with mood emojis) to a user's posts
2. /replies-to/ - Gets direct replies to a user's posts (excluding reactions and poll votes)
3. /notifications/ - Unified endpoint combining mentions, reactions, and replies with optional type filtering

Implementation details:
- All endpoints follow the existing API pattern with caching, validation, and error handling
- Comprehensive test suites with 35 passing tests
- Updated README with full documentation and examples
- Integrated into Django settings and URL configuration
- Code formatted with Ruff

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2025-10-11 10:36:47 +02:00
Andros Fenollosa
368b46e1df Fix tag search to match exact words only
- Changed tag search from substring match to exact word match
- Tags like 'emacs' now won't match 'notemacs' or 'emacs-lisp'
- Search remains case insensitive
- Added tests for exact word matching and case insensitivity
2025-10-10 14:59:28 +02:00
Andros Fenollosa
1512437147 Updated name groups with spaces 2025-10-10 07:54:55 +02:00
Andros Fenollosa
11f7c9ad29 Format code with ruff 2025-10-09 19:21:33 +02:00
Andros Fenollosa
e3b6897a7a Implement group filtering by post field instead of membership
- Add group field to Post model
- Store group name directly in posts during feed scanning
- Filter group messages by post.group field
- Remove GroupMember dependency from views
- Update tests to use direct group field
- Simpler and more efficient approach

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2025-10-09 19:13:22 +02:00
Andros Fenollosa
7345e56148 Deleted join group 2025-10-09 16:23:51 +02:00
Andros Fenollosa
f65ebac231 Add moods to parent post in replies endpoint 2025-10-08 11:16:14 +02:00
Andros Fenollosa
2ac35f6a0b Fixed headers 2025-10-02 10:25:47 +02:00
Andros Fenollosa
0da9a18ac9 Updated crons 2025-09-30 12:13:02 +02:00
Andros Fenollosa
f9373b97a0 Added moods 2025-09-25 08:05:30 +02:00
Andros Fenollosa
1afb02eae7 Updated HATEOUS 2025-09-23 18:37:55 +02:00
Andros Fenollosa
d21a996bb3 Updated endpoints 2025-09-23 16:53:11 +02:00
Andros Fenollosa
5b2b15f390 Removed old code 2025-09-23 16:30:48 +02:00
Andros Fenollosa
77e9f9b4ad Added groups 2025-09-22 16:51:18 +02:00
Andros Fenollosa
5f6666b372 Fixed format 2025-09-22 14:52:46 +02:00
Andros Fenollosa
82d65fa346 Make Org Social feed parsing case-insensitive
- Updated parser to accept #+title:, #+nick:, #+description: (lowercase)
- Added re.IGNORECASE flag to all metadata parsing regex patterns
- Fixes validation issues with feeds using lowercase keywords
- Enables registration of feeds like codeberg.org that use lowercase format
2025-09-21 12:26:52 +02:00
Andros Fenollosa
12f38af3a2 Fix polls endpoints to match README specification
- Changed /polls/ to return simple URL array instead of full objects
- Changed /polls/votes/ to use 'post' parameter instead of 'feed' and 'poll_id'
- Updated /polls/votes/ response format to match README structure
- Updated all tests to match new API format
- Added proper URL parsing and validation for post parameter
- All 16 tests passing

API changes:
- GET /polls/ -> returns array of poll URLs
- GET /polls/votes/?post=<url> -> returns vote data grouped by option
2025-09-21 12:17:40 +02:00
Andros Fenollosa
c10e222c09 Show all polls (active and expired) in GET /polls/ endpoint
- Modified _get_all_polls() to return both active and expired polls
- Added is_active field to indicate poll status
- Updated test to reflect new behavior
- Polls are ordered by creation date (newest first)
2025-09-21 12:05:41 +02:00
Andros Fenollosa
bf6797ba55 Add polls endpoints functionality
Implemented comprehensive polls API endpoints for Org Social Relay:

- GET /polls/ - List all active polls in the system
- GET /polls/?feed=<url> - Get polls for a specific feed
- GET /polls/?voter=<url> - Get votes cast by a specific voter
- GET /polls/votes/?feed=<url>&poll_id=<id> - Get votes for a specific poll

Features:
- Complete API endpoints with proper error handling
- Comprehensive test suite with 15 test cases
- Caching for improved performance
- Response format compliance with existing API patterns
- Support for filtering active vs expired polls
- Vote counting and aggregation
- Query parameter validation

Technical details:
- Created new Django app 'polls' in app/polls/
- Added polls app to Django settings and URL configuration
- Uses existing poll models from feeds app (PollOption, PollVote)
- Follows established patterns for API responses and error handling
- All tests passing with proper Given/When/Then structure
2025-09-21 11:52:25 +02:00
Andros Fenollosa
8a53198ad6 Added polls 2025-09-20 20:05:16 +02:00
Andros Fenollosa
9e434c2bc5 Fixed cache 2025-09-20 19:16:04 +02:00
Andros Fenollosa
4bf78d0648 Updated mentions 2025-09-20 10:18:17 +02:00
Andros Fenollosa
9616c5c581 Added mentions and tasks 2025-09-19 16:09:27 +02:00