#409 IRC: Riot.im integration for MVP
Opened 6 years ago by duffy. Modified 6 years ago

As discussed in the 17 Oct 2017 meeting, we need mockups to show the new MVP version of IRC integration in hubs using links out to riot.im / matrix. Below is the log from the meeting describing the idea:

15:18:39 <mizmo> abompard: could we use this in the chat widget to provide a view of the room, > and have the button to link people over to riot to chat? https://view.matrix.org/room/!cURbafjkfsMDVwdRDQ:matrix.org/
15:19:04 <abompard> mizmo: totally
15:19:20 <abompard> mizmo: we only need to know how to get that room id
15:19:34 <mizmo> ok awesome. it'll work for team hubs but not users
15:19:45 <mizmo> abompard: maybe put that burden on the hub admins for now
15:19:59 <sayan> abompard: admins fill the settings page
15:20:04 <mizmo> i can look them up manually in riot, eg this room is !pQKymaaQXBFBeuOxHn:matrix.org
15:20:05 <sayan> I mean the matrix room id
15:20:30 <mizmo> that seems really doable
15:20:43 <abompard> mizmo: yeah that's enough for a MVP, unless I find a magical API that gives me the answer easily
15:21:03 <mizmo> theres a js api for matrix, let me see if it lets you look up
15:21:54 <sayan> mizmo: nope, you cannot do that using the js dsk
15:22:02 <mizmo> https://matrix.org/docs/api/client-server/#!/Room32directory/get_matrix_client_r0_directory_room_roomAlias
15:22:11 <mizmo> so the aliases are predictable, this should work
15:22:39 <mizmo> eg the alias for this room is #freenode_#fedora-hubs:matrix.org
15:22:50 <mizmo> so you take the base IRC room name, prepend #freenode_ and append :matrix.org
15:23:07 <mizmo> that's the alias that you put into this api call
15:23:08 <abompard> mizmo: perfect
15:23:48 <mizmo> so we could just ask the hub admin for the irc channel name (as we were planning anyway), convert it to a matrix alias, then look up using the API call for the ID, and use that to pull in both the viewer and also to link over to riot
15:24:56 <abompard> Yep!
15:25:59 <mizmo> \o/
15:26:11 <abompard> sounds cool :)
15:26:11 <mizmo> i think that'll be good enough for mvp
15:26:17 <abompard> yeah I think so too
15:26:34 <mizmo> and it doesnt tie us too tightly either in case something happens
15:28:04 <abompard> yeah
15:28:45 <mizmo> cool so ill work on those mockups today and if needed tommorrow with the aim of having something to show tomm afternoon my time
15:29:10 <abompard> BTW, it works: curl -X GET --header 'Accept: application/json' 'https://matrix.org:8448/_matrix/client/r0/directory/room/%23freenode_%23fedora-hubs%3Amatrix.org'


Team / Project Hub IRC Widget

Here's what this would look like for MVP. I'm not 100% sure if this is possible.

Pre-requisites

  • The IRC channel is configured in the admin panel for the widget
  • The matrix channel for the IRC channel has been set to public
  • The API will allow us to pull these specific data pieces out (it appears to make it possible?) instead of just popping up a view.matrix.org window in an iframe.

API info

  • Converting IRC channel to matrix roomid - first you need room alias, and then convert the room alias to the room id. To get the room alias, you prepend the IRC freenode name with "#freenode_" and append ":matrix.org" to it. So, for example, '#fedora-design' would become '#freenode_#fedora-design:matrix.org'. Then, TAke this matrix room alias and use this API call to convert to room id: get /_matrix/client/r0/directory/room/{roomAlias}
  • Who's Chatting: use get /_matrix/client/r0/rooms/{roomId}/members, return first 5, return total number of members - 5. For each member in the list of 5, use
    get /_matrix/client/r0/profile/{userId}/avatar_url to get avatar graphic.
  • Latest messages: Should display 5 most recent messages. Can use
    get /_matrix/client/r0/rooms/{roomId}/messages with the option to limit to 5 messages. If possible though, manipulation on timestamps to be age would be best since we then don't have to deal with time zones and the staleness of the channel will be clearer to users.
  • Launch designteam chat: Open a new window, remove menubars if possible, should open up to riot.im/app/#/room/!DgvjtOljKujDBrxyHk:matrix.org/ (replacing with correct roomID)

Other Notes

  • The "Hide this notification" link should shade the chat widget. To re-open, unshade the widget. (^ icon in upper right)

Metadata Update from @duffy:
- Issue priority set to: High

6 years ago

Still working on the admin config side of this.

Metadata Update from @ryanlerch:
- Issue set to the milestone: Production

6 years ago

Metadata Update from @ryanlerch:
- Issue set to the milestone: None (was: Production)

6 years ago

Login to comment on this ticket.

Metadata
Attachments 3
Attached 6 years ago View Comment
Attached 6 years ago View Comment
Attached 6 years ago View Comment