Open Benjamin-Loison opened 3 months ago
Related to matrix-commander/pull/179.
grep -rw --include=*.py devices
matrix_commander/matrix_commander.py: "Verify with other devices or hit Control-C to " matrix_commander/matrix_commander.py: """List device of account while already logged in."""
matrix_commander/matrix_commander.py: resp = await client.devices()
matrix_commander/matrix_commander.py: "E180: " f"devices failed with {privacy_filter(str(resp))}"
matrix_commander/matrix_commander.py: gs.log.debug(f"devices successful with {privacy_filter(str(resp))}") matrix_commander/matrix_commander.py: for rr in resp.devices: matrix_commander/matrix_commander.py: f"Failed to delete devices because --password was not set. " matrix_commander/matrix_commander.py: devices = gs.pa.delete_device
matrix_commander/matrix_commander.py: f"About to delete devices {devices} for user {user_id} "
matrix_commander/matrix_commander.py: resp = await client.delete_devices(devices, auth)
matrix_commander/matrix_commander.py: f"Failed to delete devices {devices} for user {user_id} "
matrix_commander/matrix_commander.py: f"Failed to delete devices {devices} for user {user_id} due to " matrix_commander/matrix_commander.py: f"Successfully deleted devices {devices} for user {user_id}." matrix_commander/matrix_commander.py: if gs.pa.devices: matrix_commander/matrix_commander.py: """Log out one or all devices from Matrix server."""
matrix_commander/matrix_commander.py: gs.log.debug(f"--logout has chosen to log out devices {device}")
matrix_commander/matrix_commander.py: or gs.pa.devices
matrix_commander/matrix_commander.py: "verification between two devices of the *same* user. For that, "
matrix_commander/matrix_commander.py: "You should now be verified across all devices and across all users.",
matrix_commander/matrix_commander.py: "Details:: Logout this or all devices from the Matrix homeserver. "
matrix_commander/matrix_commander.py: "If you choose 'all', all devices of the user used by "
matrix_commander/matrix_commander.py: "differentdevices and users.",
matrix_commander/matrix_commander.py: "--devices",
matrix_commander/matrix_commander.py: "--get-devices", # alias, cause --deviced is very similar to --device
matrix_commander/matrix_commander.py: help="Print the list of devices. "
matrix_commander/matrix_commander.py: help=f"Delete one or multiple devices. "
matrix_commander/matrix_commander.py: "Details:: By default devices belonging "
matrix_commander/matrix_commander.py: f"to {PROG_WITHOUT_EXT} will be deleted. If the devices belong "
matrix_commander/matrix_commander.py: "--device", # do not confuse with --devices
matrix_commander/matrix_commander.py: "Multiple devices (with different device id) may have the same device "
matrix_commander/matrix_commander.py: "differentdevices if desired.",
matrix_commander/matrix_commander.py:<--devices,> <--get-devices>
matrix_commander/matrix_commander.py:Print the list of devices.
matrix_commander/matrix_commander.py:Delete one or multiple devices.
matrix_commander/matrix_commander.py: "to verify devices. "
matrix_commander/matrix_commander.py: "devices, etc. It can send one or multiple message to one or "
matrix-commander/blob/078da5f16c9b94893939ad19a21677f84a8625f9/requirements.txt#L9
https://pypi.org/project/matrix-nio/
https://matrix-nio.readthedocs.io/en/latest/#api-documentation
https://matrix-nio.readthedocs.io/en/latest/nio.html#nio.Api.devices
matrix nio get current device results of DuckDuckGo and Google do not help much.
Both
gs.log.error(f'{client.device_id=}')
and
jq '.device_id' ~/.config/matrix-commander/credentials.json
work fine.
~/.config/matrix-commander/credentials.json
:
{
"homeserver": "https://matrix.org",
"device_id": "CENSORED",
"user_id": "@CENSORED:matrix.org",
"room_id": "!CENSORED:matrix.org",
"access_token": "CENSORED"
}
Session id is not the device id.
When searching session in matrix-commander/issues relevant issues are:
In matrix-commander-rs/issues there are no relevant issues, without filtering with session, according to their titles.
When log out of https://app.element.io there seems to be an interesting prompt.
Related to commit/1470570846f66b6c590b22d56ce9e8dda379fe30.
hostname
overclock3000
whoami
benjamin
matrix-commander -v
_| _| _|_|_| _| matrix-commander: 7.7.0 2024-09-04
_|_| _|_| _| _| a Matrix CLI client
_| _| _| _| _| enjoy and submit PRs
_| _| _| _| matrix-nio: 0.25.0
_| _| _|_|_| _| Python: 3.11.2
matrix-commander --verify emojireq
2024-09-20 19:25:47,254: ERROR: matrix-commander: E240: For --verify manual and --verify emojireq a device must be specified with --device.
2024-09-20 19:25:47,255: INFO: matrix-commander: 1 error and 0 warnings occurred.
matrix-commander -h
...
--verify [EMOJI]
Perform verification.
...
--devices, --get-devices
Print the list of devices.
...
--device DEVICE_NAME
Specify a device name, for use by certain actions.
...
does not mention added means of verification, should proceed to an exhaustive verification then.
matrix-commander --get-devices
Maybe first should remove no more used devices and see when logged with the given account how it looks.
Maybe the expected device is the other account one.
Related to Benjamin_Loison/cron/issues/11.
return all devices, not the one we are using.
Related to #18.
+65