* Add ability to sync all LINE contacts, which is relevant because the
list of recent chats excludes users you haven't spoken to lately.
* Add bot command to list all contacts.
* Allow inviting a puppet to a DM to create a portal for that LINE user,
instead of having to wait for that user to message you first.
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
* 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
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
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.
- 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
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.
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.
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.
...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.
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.
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).