Commit Graph

36 Commits

Author SHA1 Message Date
Evilham dc0db05d07
Minor localisation and usability bugfixes
When the server's locale and/or timezone are different from that in
Gancio, weird things were happening.

While there, we make `renderEvent` a tad more modular so that
potentially new settings can be introduced in the future.

Introduced changes:

- `renderEventDateTime` uses both Gancio's locale and timezone, this
  has the effect that (in theory! please test) no matter the server's
  timezone, the message will be rendered according to Gancio's
  settings (which is, I'd argue, an admin's expectation)
- `renderEventTitle` generates a link to Gancio's event, which people
  can use to get more info
- I noticed while importing events that sometimes the `description`
  field could be prefilled with `null` as a string, while this might
  be a Gancio bug to fix, we can also skip those descriptions

New boolean configuration options:
- `skip_link_to_gancio`: it skips the final link to Gancio making the
  message slightly shorter
- `tags_link_to_gancio`: it affects `renderEventTags`, which by
  default allows Telegram to handle tags. When this option is applied,
  tags link instead to their Gancio site, which lists all related
  events on the instance
2023-05-31 20:57:25 +02:00
fadelkon 971ea23b6a
version 1.0.1 2023-05-10 18:33:06 +02:00
fadelkon 3dd7581424
Handle case when event description is empty 2023-05-10 18:26:59 +02:00
fadelkon 7a425fd843
Merge branch 'simplify-to-telegram-html' 2023-05-10 18:26:48 +02:00
fadelkon c07cd3fdc7
prevent image errors when developing 2023-05-10 18:10:26 +02:00
fadelkon dd2b924d8b
version 1.0.0 2023-05-10 17:08:33 +02:00
fadelkon 0b5f30cc40 Add dependencies to sanitize html
libraries and their versions are copied from main gancio
2023-05-10 17:03:27 +02:00
fadelkon 9f4bade3d8 Purge all html tags that make Tg reject our events
I first clean any linefeed, and then convert p and br to linefeed.
List items, be ordered or not, I convert them to bullet list items.

Then, gancio sanitize html is used, so that we clean facebook tracking
id and any other possible hooks that may be added, and after that, the
final sanitize, using the same dompurify as main gancio, but with a more
restricted list of tags, only those that are allowed by Telegram.

At the same time, if the place has coordinates set, the place name links to
OpenStreetMap with a marker set on. Now the place shows up after the
description.

Date and time are now shown after the description and split. Time shows
in 24h format (hopefully) and ignores seconds.
2023-05-10 16:46:06 +02:00
fadelkon 7246da209b Merge branch 'add-logging' into 'main'
Use gancio's log and reuse same bot instance

Closes #6

See merge request bcn.convocala/gancio-plugin-telegram-bridge!6
2023-05-09 20:19:45 +00:00
fadelkon 3c32591f37 fix syntax error
a trailing comma
2023-05-09 22:12:24 +02:00
fadelkon 992dbba8b8 Use gancio's log and reuse same bot instance
Also, capture and log the response to calls to the telegraf library
2023-05-09 22:02:15 +02:00
fadelkon 48552eb7fb Fix reading of some settings 2023-05-09 22:00:35 +02:00
fadelkon 0882989d62 Merge branch 'add-on-test' into 'main'
Add a simple onTest callback

Closes #3

See merge request bcn.convocala/gancio-plugin-telegram-bridge!5
2023-05-08 21:38:10 +00:00
fadelkon 12a97a41b4 Add a simple onTest callback 2023-05-08 23:36:24 +02:00
fadelkon 748d7b1be6
Merge branch 'main' of framagit.org:bcn.convocala/gancio-plugin-telegram-bridge 2023-04-19 20:22:45 +02:00
fadelkon 576d322799
update readme 2023-04-19 20:21:43 +02:00
fadelkon 9749bfae66
update readme 2023-04-19 19:51:03 +02:00
fadelkon 8cb8fca654 Merge branch 'feat/improvement' into 'main'
Feat/improvement

Closes #4 and #5

See merge request bcn.convocala/gancio-plugin-telegram-bridge!4
2023-01-26 00:24:21 +00:00
fadelkon f4fdc16dd6 Merge branch 'add-npm-i' into 'main'
add instructions to install dependencies

See merge request bcn.convocala/gancio-plugin-telegram-bridge!3
2023-01-26 00:22:52 +00:00
lesion c1237728ad use settings instead of config and instance's title 2022-12-10 17:28:28 +01:00
lesion 84f58e9e56 use event image, fix #5 2022-12-10 13:22:07 +01:00
Albatroz Jeremias b94d53a074 add instructions to install dependencies 2022-12-08 17:21:54 +00:00
lesion 0486d0852d minor on README 2022-11-30 16:35:43 +01:00
lesion 88652a6f36 minor on plugin description 2022-11-30 16:33:12 +01:00
fadelkon 3f36800b44 Merge branch 'main' into 'main'
add hints

See merge request bcn.convocala/gancio-plugin-telegram-bridge!2
2022-11-25 23:37:20 +00:00
lesion 1264046148 minor 2022-11-04 12:22:35 +01:00
lesion 75c191639d add hints 2022-10-13 12:01:44 +02:00
fadelkon 507583e4e5 Update README.md to reflect changes from !1 2022-09-11 16:29:27 +00:00
fadelkon 96789b6092 Merge branch 'main' into 'main'
start with generic plugin configuration, using this plugin as a test

See merge request bcn.convocala/gancio-plugin-telegram-bridge!1
2022-09-11 16:11:38 +00:00
lesion 83312e252a use this as plugin example 2022-08-31 11:20:03 +02:00
lesion f4c0bdfa09 start with generic plugin configuration, using this plugin as a test 2022-08-09 18:38:38 +02:00
fadelkon a079bff738 Add v0.1.0 screenshot 2022-07-04 18:25:53 +02:00
fadelkon 21e92bac4c Update README.md 2022-07-04 16:22:49 +00:00
fadelkon e46fb23a49 Add README.md 2022-07-04 16:21:28 +00:00
Convoca-la Barcelona 4dfe85dcb7 Add LICENSE 2022-07-04 15:57:54 +00:00
fadelkon 1308f883a8 First minimal working version! 2022-07-04 17:54:33 +02:00