1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2024-12-23 02:02:33 +01:00
ntfy/server
Michael Manganiello 49bd6129ff Convert mailer_emoji JSON file to map
This fixes a pending TODO comment regarding inefficient tags to emojis
mapping, by requiring a full scan over emoji aliases to determine
matches.

Instead, now the JSON file is a map, with aliases as keys, and emojis as
values. The script to convert the file with Python was:

```python
import json

with open("./mailer_emoji.json", "r", encoding="utf-8") as f:
    content = json.load(f)

emoji_map = {}
for emoji in content:
    for alias in emoji["aliases"]:
        if alias in emoji_map:
            print("WARNING: Duplicate alias:", alias)
            continue
        emoji_map[alias] = str(emoji["emoji"])

sorted_emoji_map = {k: emoji_map[k] for k in sorted(emoji_map)}

with open("./mailer_emoji_map.json", "w", encoding="utf-8") as f:
    json.dump(sorted_emoji_map, f, indent=4, ensure_ascii=False)
```
2023-05-13 11:43:47 -03:00
..
actions.go Bump Go version, Generics whoooo 2022-10-01 15:50:48 -04:00
actions_test.go
config.go
config_test.go
errors.go
file_cache.go Allow /metrics on default port; reduce memory if not enabled 2023-03-15 22:34:06 -04:00
file_cache_test.go
log.go Allow SMTP servers without auth 2023-03-02 20:25:13 -05:00
mailer_emoji_map.json
message_cache.go
message_cache_test.go
ntfy.service Add --trace and --no-log-dates; add docs 2022-06-02 10:50:05 -04:00
server.go
server.yml Remove old homepage 2023-05-01 11:58:49 -04:00
server_account.go
server_account_test.go
server_firebase.go
server_firebase_test.go
server_manager.go
server_manager_test.go
server_matrix.go
server_matrix_test.go
server_metrics.go
server_middleware.go
server_payments.go
server_payments_test.go
server_test.go
smtp_sender.go
smtp_sender_test.go
smtp_server.go
smtp_server_test.go
topic.go
topic_test.go Fix test and retry 2023-05-02 14:16:59 -04:00
types.go
util.go Simplify 2023-04-21 21:07:07 -04:00
util_test.go Return HTTP 500 on Matrix discovery GET if base-url not configured; log entire HTTP request when TRACE enabled 2022-06-19 21:25:35 -04:00
visitor.go Add visitor_seen to the log context 2023-03-03 13:56:48 -05:00