Commit Graph

165 Commits

Author SHA1 Message Date
ce31caa034 Add instructions for systemd and Docker 2021-07-15 03:35:07 -04:00
81553df1c4 Try to fix some errors caused by bad ordering 2021-07-14 03:17:07 -04:00
70c21e528f Merge branch 'systemd' into testing 2021-07-14 02:44:07 -04:00
d5cd9fe8b9 Tweak systemd units
Changes include:
* Remove target unit
* Create and use config directory
* Use directory directly under /opt as home
* Rename suggested user/group
* Restart on failure
* (aside) Rename Node module name after Chrome unit
2021-07-14 02:40:35 -04:00
b7734aa9ba Merge remote-tracking branch 'lecris/systemd' into systemd 2021-07-13 02:38:42 -04:00
be1ec0217c Update Dockerfiles and dependencies
* Update Dockerfiles to work properly
* Use latest available version of Alpine Linux
* Update Puppeteer to 9.1.1 to match Chrome version available in latest
  Alpine Linux
* Add docker script for Node process to allow custom config
* Provide separate example config for running Node in docker

TODO: Update SETUP.md with Docker instructions
2021-07-12 02:27:33 -04:00
570eedf904 Auto-derive the installed LINE extension's UUID 2021-07-08 02:25:30 -04:00
975e9c5369 Wait for open connection on startup 2021-07-07 02:22:12 -04:00
f4bd0ca1c9 Use longer timeout for outgoing messages 2021-07-07 01:25:56 -04:00
20ec4f92fa Update roadmap 2021-07-07 01:24:22 -04:00
e0f21ed824 Don't error on member leave if puppet left already 2021-07-05 18:51:29 -04:00
9e739e9908 Track LINE user joins and leaves
Also try to improve accuracy of message dates, and matching user names
to their proper ID & avatar
2021-07-05 02:37:14 -04:00
9f0d239f4e Fix some docstrings 2021-07-05 01:25:51 -04:00
09cea5b43c Make puppets leave instead of kicking them 2021-07-03 18:24:09 -04:00
c4be4d79ed Proper usage of asyncio exceptions
They belong to the asyncio package, not asyncio.exceptions.
Also remove an unused Tuple import
2021-07-03 12:49:21 -04:00
0672d41431 Update participants in DMs again
Needed to kick own puppet when double-puppeting is re-enabled
2021-07-03 12:43:34 -04:00
120e4e11f7 Lower minimum required Python version to 3.7
Just use Dict instead of TypedDict
2021-07-03 03:11:15 -04:00
4e21113940 Add config for setting custom Chromium path
Also update SETUP/README with instructions
2021-07-03 02:07:59 -04:00
70061a560f Update default avatar 2021-07-02 14:10:35 -04:00
cd0ef67465 Update docs 2021-07-02 14:04:53 -04:00
69028c6edd Fix problems with outgoing messages
1. Don't set the "own message" promise to null on resolve, as other
   places may still be awaiting on it afterwards
2. Retry pressing "Enter" to send a message if it doesn't work on the
   first try, which can happen for some reason
2021-07-02 14:04:53 -04:00
e1b822bd52 Jiggle mouse with xdotool to keep LINE alive
Even if Chrome is the only window in an X session, and even if the
window is focused, the LINE extension stops getting new messages unless
the mouse has moved recently. To work around that, use xdotool to move
the mouse every so often.
2021-07-02 14:04:53 -04:00
915e3daa06 Convert data-local-id to number when needed 2021-07-02 14:04:53 -04:00
921b5a6201 Commonize participant list selector 2021-07-02 14:04:53 -04:00
5a560da5ab Update contentscript.js docstrings 2021-07-02 14:04:53 -04:00
914d77a24b Tweak database upgrade code style 2021-07-02 14:04:53 -04:00
1fddc563e2 Avoid conflicting actions during sync
More is likely need for this to work well
2021-07-02 14:04:53 -04:00
8c2c0126c9 Sync, store, and poll for incoming read receipts 2021-07-02 14:04:52 -04:00
3c0dd15616
Add RuntimeDirectory for sockets 2021-06-23 10:21:28 +09:00
4172541e9b
Fix ordering and dependence 2021-06-23 10:21:28 +09:00
10308fdf6d
Use notify for systemd 2021-06-23 10:21:27 +09:00
846285e5b7
Initial Systemd services 2021-06-23 10:21:27 +09:00
c124b4c49e Replace str.removeprefix
to avoid having to bump Python version to 3.9
2021-06-18 00:38:45 -04:00
2fec597cba Tweak window size
Helps when running in Xvnc
2021-06-18 00:09:20 -04:00
157f18d27f Update .gitignore 2021-06-18 00:08:41 -04:00
2c026939c3 Minor formatting fixes 2021-06-17 23:59:25 -04:00
f05a91e95d Better checks for chat messages to appear
- Re-click on a chat item if one click didn't work for some reason
- Wait long for a single message to appear, but stop early when found
- After single message found, wait less for more changes
2021-06-17 23:55:19 -04:00
40a48d12a2 Don't view groups/rooms when possible, via MSC2409
Use the sidebar to sync non-DM messages, just like what's done for DM
messages.

However, since sidebar messages don't say who sent a message, this
requires scanning read receipts with MSC2409: when a non-DM sidebar
message is seen, the bridge bot sends that message. Only when that
placeholder is viewed in Matrix does Puppeteer actually view the non-DM
chat to find who really sent the message. Then the bridgebot redacts its
message, and the message gets re-sent by the puppet of the LINE user who
really sent it.
2021-06-17 23:32:45 -04:00
1ae30bcf1b Use read receipts to know when to sync media
Instead of having to view a LINE chat when a media message is sent, send
a placeholder message that gets replaced with the actual media when it's
viewed in Matrix.
2021-06-17 00:42:06 -04:00
a3e7caac27 Merge branch 'master' into better-receipts-msc2409 2021-06-16 22:14:26 -04:00
ee5ccf9b2f Attempt to wait for chat messages to appear
When opening a chat (like during a sync or in response to a new message
notification), the message list loads lazily, so not waiting for all
items to load can cause messages to be missed.

However, there doesn't seem to be any indicator for when a message list
has been fully loaded...

As a best effort attempt, simply wait until no new updates to the
message list have been seen for a while.
2021-06-16 02:27:27 -04:00
555b19c289 Always use LINE puppet for own messages
...that are sent from another client.

Also look up the profile data for the user's LINE account on sync,
including at startup, so that there's always a puppet available.
2021-06-15 02:55:55 -04:00
0d154c826e Fix outbound message sending
The message text input field in LINE chats doesn't play nice with
Puppeteer's "type" function for live-typing text...

It's a div instead of a text input, and uses innerText instead of value.
Setting its innerText directly seems to work best, so just use that.
2021-06-14 01:54:24 -04:00
8fb0e2a101 Add missing await
And a safer null check
2021-06-14 01:53:26 -04:00
33ca6223c5 Use MSC2409 to send outgoing read receipts
When a message is viewed in Matrix, make Puppeteer view its LINE chat
2021-06-11 02:53:30 -04:00
85dc7a842e Don't view LINE DMs whenever possible
Use the sidebar to sync DM messages instead of visiting the DM itself,
so as to not make LINE (and your contact) think you really read the DM.

This cannot be done for non-text messages (which are not previwable in
the sidebar) and non-DM chats (whose sidebar messages don't say who sent
a message).
2021-06-10 02:54:12 -04:00
0d849cf2bb JSON stringify objects before logging them
Because Eclipse/Wild Web Developer messes them up
2021-06-10 02:52:25 -04:00
e37a7c41bf Minor formatting changes 2021-06-10 02:52:13 -04:00
1cf840e3d9 maunium -> miscworks 2021-06-10 02:51:23 -04:00
02cc6ce0e4 Add missing await 2021-06-10 02:19:24 -04:00