!GsmxjHfeAYLsTEQmjS:nixos.org

Matrix Meta (Nix)

659 Members
Discuss your proposals for the Matrix space here, before suggesting them in #matrix-suggestions:nixos.org189 Servers

Load older messages


SenderMessageTime
23 Jul 2021
@grahamc:nixos.org@grahamc:nixos.orghow about making every room have a unique icon by feeding its name / topic in to one of those creepy image generators11:24:27
@kevincox:matrix.orgkevincoxI would rather have a shitty unique icon than no icon. We can always get someone to make a better icon generator later.11:28:21
@kevincox:matrix.orgkevincoxI mean someone here probably knows how to use imagemagick11:28:38
@grahamc:nixos.org@grahamc:nixos.orgyeah11:28:45
@grahamc:nixos.org@grahamc:nixos.orgI get super lost in all the N's11:28:51
@schnecfk:ruhr-uni-bochum.deCRTifiedMe too11:29:12
@grahamc:nixos.org@grahamc:nixos.orgI have a tool to enumerate all the rooms, maybe someone could find a way to take the name and generate a random picture, github avatar style?11:29:32
@kevincox:matrix.orgkevincox
% name="example"
%wget -O "$name.img" "https://www.gravatar.com/avatar/$(md5sum <<<"$name")?d=robohash&f=y"
11:37:38
@kevincox:matrix.orgkevincox *
% name="example"
% wget -O "$name.img" "https://www.gravatar.com/avatar/$(md5sum <<<"$name")?d=robohash&f=y"
11:37:42
@kevincox:matrix.orgkevincoxYou can bikeshed over the supported generators: https://en.gravatar.com/site/implement/images/#highlighter_81148511:38:15
@grahamc:nixos.org@grahamc:nixos.orgoh cool11:38:27
@kevincox:matrix.orgkevincoxI think there are other sites available as well but this seems good enough 🤷11:39:19
@grahamc:nixos.org@grahamc:nixos.orga very nice API :)11:39:27
@grahamc:nixos.org@grahamc:nixos.org anyone know how to get an mxc url? mxc://nixos.org/f99b43034eae3a82706e86aca15300fda8210b79 11:44:44
@schnecfk:ruhr-uni-bochum.deCRTifiedThat should just be a media identifier, one second11:45:05
@grahamc:nixos.org@grahamc:nixos.orgyeah11:45:13
@schnecfk:ruhr-uni-bochum.deCRTifiedhttps://matrix.org/_matrix/media/r0/download/nixos.org/f99b43034eae3a82706e86aca15300fda8210b7911:45:41
@schnecfk:ruhr-uni-bochum.deCRTifiedYou can just plug it in the end of that URL11:45:49
@grahamc:nixos.org@grahamc:nixos.orgoh cool11:45:53
@schnecfk:ruhr-uni-bochum.deCRTifiedIn the end, its basically all HTTP11:46:16
@grahamc:nixos.org@grahamc:nixos.orgyeah :) with some manipulation I suppose11:46:25
@schnecfk:ruhr-uni-bochum.deCRTifiedYou can also swap out the host and use the same URL on different homeservers, it will fetch (and cache) the download from the homeserver in the URL11:47:06
@grahamc:nixos.org@grahamc:nixos.org
$ synadm -o json room details '!VjfUzaKsXokUdnQcvP:nixos.org' | jq .
{
  "room_id": "!VjfUzaKsXokUdnQcvP:nixos.org",
  "name": "Nix Python",
  "canonical_alias": "#python:nixos.org",
  "joined_members": 50,
  "joined_local_members": 2,
  "version": "6",
  "creator": "@grahamc:nixos.org",
  "encryption": null,
  "federatable": true,
  "public": true,
  "join_rules": "public",
  "guest_access": null,
  "history_visibility": "world_readable",
  "state_events": 62,
  "avatar": null,
  "topic": "Anything regarding using Python with Nix.",
  "joined_local_devices": 12
}

so iterating over each room id, filtering out rooms with a null avatar, and then figuring out how to upload media and update the room id

11:47:54
@kevincox:matrix.orgkevincoxIf you post an image Element will also let you view source and see the mxc URL. But that isn't too convenient for automation.11:47:54
@grahamc:nixos.org@grahamc:nixos.orgyeah, I wonder what the API is like to upload the image automatically13:24:19
@grahamc:nixos.org@grahamc:nixos.org maybe sumner has ideas here 13:24:25
@kevincox:matrix.orgkevincox

It looks like you could combine:

13:28:30
@sumner:sumnerevans.comsumner
In reply to @grahamc:nixos.org
yeah, I wonder what the API is like to upload the image automatically
Just send it bytes I think: https://matrix.org/docs/spec/client_server/r0.4.0#post-matrix-media-r0-upload
14:18:55
@sumner:sumnerevans.comsumner It gives you the MXC URI as a response. Normally clients will then turn around right away and send it in a message, but in this case you just need to add it to a m.room.avatar state event (https://matrix.org/docs/spec/client_server/r0.4.0#m-room-avatar) which can be created with this endpoint: https://matrix.org/docs/spec/client_server/r0.4.0#put-matrix-client-r0-rooms-roomid-state-eventtype 14:22:37
@grahamc:nixos.org@grahamc:nixos.orgcool14:59:06

Show newer messages


Back to Room ListRoom Version: 6