Add comprehensive custom emoji support with instance-specific emojis

- Create CustomEmojiManager for fetching, caching, and searching custom emojis
- Add get_custom_emojis() API method to ActivityPub client for /api/v1/custom_emojis
- Implement hybrid emoji autocomplete showing both Unicode and custom emojis
- Cache custom emojis per instance in ~/.cache/bifrost/custom_emojis/ for performance
- Support proper emoji insertion: Unicode as characters, custom as :shortcode: format
- Add visual distinction with "(custom)" suffix in autocomplete suggestions
- Smart emoji limits: 5 Unicode + 5 custom emojis in autocomplete dropdown
- Automatic emoji loading when compose dialog opens for seamless experience

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Storm Dragon
2025-07-21 11:24:12 -04:00
parent 3d9ce28334
commit e96ce0c861
2 changed files with 187 additions and 0 deletions

View File

@@ -444,6 +444,10 @@ class ActivityPubClient:
params['max_id'] = max_id
return self._make_request('GET', '/api/v1/mutes', params=params)
def get_custom_emojis(self) -> List[Dict]:
"""Get list of custom emojis available on this instance"""
return self._make_request('GET', '/api/v1/custom_emojis')
class AuthenticationError(Exception):