Commit Graph

879 Commits

Author SHA1 Message Date
Patrick Connolly
ae5c3f02ee Added lots of debug output while working on PR. 2018-10-15 08:40:35 +08:00
Patrick Connolly
ea89e62a96 Don't contact google to translate empty messages. 2018-10-15 08:35:34 +08:00
Patrick Connolly
03e2b90a24 Merge branch 'master' into 499-google-translation 2018-10-15 07:09:37 +08:00
Patrick Connolly
f32e7a9c35 Moved translation attribute into toml config. Now using origmsg var for msg text. 2018-10-15 06:48:14 +08:00
Patrick Connolly
4eaa59c594 Went back to using <pre> for multiline code. 2018-10-15 04:38:35 +08:00
Patrick Connolly
b339e21526 Added ability to render slackdown bold. 2018-10-15 04:10:23 +08:00
Patrick Connolly
ddda1aad1a Cleaned up language checks. 2018-10-15 03:52:06 +08:00
Patrick Connolly
aeb06c7478 Moved translation client from bridge to router. 2018-10-15 03:50:44 +08:00
Patrick Connolly
3e036b370a Fixed list parsing. 2018-10-15 03:07:02 +08:00
Patrick Connolly
02c99569d8 Use close brackets in br tags etc. 2018-10-15 03:06:24 +08:00
Patrick Connolly
8808ee4e39 Allowed preservation of codeblock formatting between translations. 2018-10-15 01:07:39 +08:00
Patrick Connolly
9cdb44d919 Added ability to handle strikethrough after slackdown parsing. (Updated html2md pkg.) 2018-10-14 23:11:52 +08:00
Patrick Connolly
3253bf2d47 First pass at preserving slackdown format through translation. 2018-10-14 23:07:45 +08:00
Patrick Connolly
93f252c223 Sorted @usernames and #channels by length so translation protections happens correctly. 2018-10-14 22:26:55 +08:00
Patrick Connolly
170b42c1ad Added the better HTML strip library. 2018-10-14 22:12:17 +08:00
Patrick Connolly
c975ac0ff3 Fixed url matching to protect from translation. 2018-10-14 17:53:34 +08:00
Patrick Connolly
44e6f99e62 Added fix for Google Translate bug. 2018-10-14 17:30:01 +08:00
Patrick Connolly
6d4be25037 Simplified emoji replacement in Google Translate. 2018-10-14 17:00:58 +08:00
Patrick Connolly
0185e86e74 Initialized Google Translation during bridge init. 2018-10-14 14:45:40 +08:00
Patrick Connolly
ceb078bd5b Added mention of how to set google credentials. 2018-10-14 11:35:18 +08:00
Duco van Amstel
498377a230 Clean up code and strengthening (slack) (#519)
Changes include:
- Refactor of strings into package-wide constants.
- Predeclaration of regexps to be instantiated at package load time.
- Checking of unchecked errors.
- Structural changes:
  - Adding verifications to type-casting code.
  - Remove unnecessary 'len(X) > 0' checks before iterating over X.
  - Remove unnecessary 'else' clause after 'if' with 'return'.
  - Unexporting of public fields of Bridge struct.
- Formatting:
  - One-field-per-line struct definitions.
2018-10-13 01:02:14 +02:00
Duco van Amstel
3dd4ec57ff Fix race in gateway test. (#520) 2018-10-13 00:47:18 +02:00
Duco van Amstel
e15b0e04b8 Refactor slack bridge prelude (#517)
Distributing the source of the Slack bridge across multiple files to
increase readability and as a prelude to various refactors and
clean-ups.
2018-10-12 23:16:34 +02:00
Duco van Amstel
97b1fc813b Bump Go version in Travis CI (#518) 2018-10-12 23:14:36 +02:00
Patrick Connolly
468c64049f Ignored emoji during translation. 2018-10-11 17:50:16 +08:00
Patrick Connolly
1d07b1faee Added origin CHANNEL to RemoteNickFormat. Updated config docs. [Fixes #515] 2018-10-11 14:59:26 +08:00
Patrick Connolly
914f32e9d0 Updated README. 2018-10-11 14:16:36 +08:00
Patrick Connolly
49f2e77f84 Allowed translation attribution text to be customized. 2018-10-11 14:16:23 +08:00
Patrick Connolly
ee7d9c8fb8 Fixed attribution conditional logic. 2018-10-11 14:02:42 +08:00
Patrick Connolly
f67b601900 Only add Google Translate attribution on translated messages. 2018-10-11 13:44:50 +08:00
Patrick Connolly
e76a61e82b Ignore translation of @usernames and #channelnames. 2018-10-09 03:15:59 +08:00
Patrick Connolly
aac7cffbdf Allow credentials to be set from base64 encoded envvar, instead of filesystem. 2018-10-08 17:55:20 +08:00
Patrick Connolly
7e1d9ed8c2 Translation works with no error checking! 2018-10-08 17:01:26 +08:00
Patrick Connolly
6dc3375c97 Transformed message. bugfix 2018-10-08 14:48:25 +08:00
Duco van Amstel
917040b044 Update of nlopes/slack dependency (#511) 2018-10-07 23:17:46 +02:00
Duco van Amstel
69646a160d Add Gateway's name to RemoteNickFormat (#501)
In order to support extra use cases we should add the `{GATEWAY}` tag to the `RemoteNickFormat` string which would be replaced by the value of the `name=` field from a gateway's configuration.

This is _very_ useful when you are forwarding, for example, multiple channels from one chat to a single channel on another one (one-way). It will help you identify the source channel of a message on the target chat.
2018-10-07 15:22:15 +02:00
NikkyAI
54adb0509e Fix mentions cuttíng off all text after the mention (discord) (#506) 2018-09-29 20:02:59 +02:00
Patrick Connolly
b9be663bc4 Added editorconfig for tab spacing. 2018-09-28 18:05:06 +08:00
Patrick Connolly
8e6e8fa8ed Added debugging to test translation. 2018-09-28 18:04:45 +08:00
Wim
bd3a3b6eaf Let webhook also replace mentions (discord). Closes #502 2018-09-22 22:15:19 +02:00
NikkyAI
296428d53e Fix Discord mentions by populating the nickMemberMap at connect (#498) 2018-09-17 21:25:06 +02:00
Wim
e0ca876de2 Update vendor lrstanley/girc 2018-09-14 00:18:20 +02:00
Jerry Heiselman
a431a4fa04 Replace @... string with user mention if match found (discord) (#492). Closes #460
* Added check for @-mention pattern and replacing it with a user with a matching Nick on incoming messages
2018-09-12 22:30:14 +02:00
Declan Hoare
cc2bd03ec9 Add Mattereddit to README.md (#493) 2018-09-01 18:45:41 +02:00
Wim
1fe81b7d1e Bump version 2018-08-30 23:14:37 +02:00
Wim
0bd5a0d92d Release v1.11.3 v1.11.3 2018-08-30 23:10:05 +02:00
Wim
330ddb6a30 Fix panic by using matterclient calls in the right place. Related to cb7278eb (mattermost). Closes #491 2018-08-30 23:04:50 +02:00
Wim
52dbd702ad Get up to 1000 channels and private/mp/im channels (slack). Related to #489 2018-08-28 22:33:07 +02:00
Wim
d7c3570ba3 Check nickname on kick (irc). Closes #488 2018-08-27 21:20:41 +02:00
Wim
ab4d51b40b Bump version 2018-08-19 23:32:42 +02:00