Add Matrix DM support - Start from Matrix side
Add Matrix DM support so Matrix users can start a DM with a Gitter user.
Fix #2671 (closed)
Dev notes
Put Matrix username last so when it gets truncated in the left-menu, it shows the Matrix user first
/matrix/5f762e89986e461e663059c2/@root:my.matrix.host
- https://matrix.org/docs/spec/client_server/latest#module-dm
-
m.room.member
will havecontent.is_direct
for the invited user - DM rooms for a given user can be looked by from
m.direct
events in/user/<user_id>/account_data/<type>
db.groups.insert({
"lcUri" : "matrix",
"uri" : "matrix",
"sd" : {
"extraAdmins" : [
db.users.findOne({ username: 'MadLittleMods' })._id
],
"extraMembers" : [ ],
"members" : "PUBLIC",
"public" : true,
"admins" : "MANUAL",
"type" : null
},
"lcHomeUri" : "matrix/home",
"homeUri" : "matrix/home",
"name" : "Matrix",
});
db.troupes.insert({
"lcUri" : "matrix/5f762e89986e461e663059c2/@root:my.matrix.host",
"uri" : "matrix/5f762e89986e461e663059c2/@root:my.matrix.host",
"topic" : "",
"sd" : {
"extraAdmins" : [ ],
"extraMembers" : [
db.users.findOne({ username: 'MadLittleMods' })._id
],
"members" : 'INVITE',
"public" : false,
"admins" : 'MANUAL',
"type" : null
},
"groupId" : db.groups.findOne({ lcUri: 'matrix' })._id,
});
db.troupes.update({ "lcUri" : "matrix/5f762e89986e461e663059c2/@root:my.matrix.host", }, {
$set: {
"lcUri" : "matrix/5f762e89986e461e663059c2/@root:my.matrix.host",
"uri" : "matrix/5f762e89986e461e663059c2/@root:my.matrix.host",
"topic" : "",
"sd" : {
"extraAdmins" : [ ],
"extraMembers" : [
db.users.findOne({ username: 'MadLittleMods' })._id
],
"members" : 'INVITE',
"public" : false,
"admins" : 'MANUAL',
"type" : null
},
"groupId" : db.groups.findOne({ lcUri: 'matrix' })._id,
}
});
db.matricesbridgedroom.insert({
"troupeId" : db.troupes.findOne({ lcUri: 'matrix/@root:my.matrix.host/5f762e89986e461e663059c2' }),
"matrixRoomId" : "!URTudnLsoukCiVEQWT:my.matrix.host",
})
Todo
-
Start DM conversation with Gitter user from the Matrix side -
Avatars- Because Gitter only has community/group avatars, we won't be able to set individual ones but we can set it as a Matrix logo.
-
Add tests -
Update matrixUtils.ensureCorrectRoomState
for DM rooms- Maybe it doesn't matter. The bridge can try and update but will fail to have permissions in a DM room.
-
When someone invites others to the private room, inform the other party -
People can leave the room so we need to invite them back any time a new message is sent
Next iteration:
-
Start DM conversation with Matrix user from the Gitter side -> !2168 (merged)
Future:
-
Show virtualUsers
in Gitter room member roster list, #2688
Considerations/known limitations:
- Virtual User in the member list roster
- Being able to invite others to the private room
- Being able to leave the room (although we can invite them back any time a new message is sent)
- Matrix DM's not available under the people one to one section in the left-menu
Edited by Eric Eastwood