Merge branch 'typingcroc-dev-patch-16163' into 'dev'
Update matrix.js to remove error and fix spacing/tab inconsistencies See merge request Shinobi-Systems/Shinobi!447better-liveGrid-monitor-item
commit
bf4a40a3a5
|
@ -1,4 +1,3 @@
|
|||
cat Shinobi/libs/notifications/matrix.js
|
||||
const fs = require("fs")
|
||||
const fetch = require("node-fetch")
|
||||
module.exports = function(s,config,lang,getSnapshot){
|
||||
|
@ -16,17 +15,17 @@ module.exports = function(s,config,lang,getSnapshot){
|
|||
buffer,
|
||||
name,
|
||||
type,
|
||||
info,
|
||||
opttype,
|
||||
info,
|
||||
opttype,
|
||||
} = file;
|
||||
client.uploadContent(buffer, {
|
||||
name: name,
|
||||
type: opttype,
|
||||
type: opttype,
|
||||
}).then(function(url) {
|
||||
const content = {
|
||||
msgtype: type || "m.file",
|
||||
body: name,
|
||||
info: info,
|
||||
info: info,
|
||||
url: url.content_uri
|
||||
};
|
||||
client.sendMessage(roomId, content);
|
||||
|
@ -97,10 +96,10 @@ module.exports = function(s,config,lang,getSnapshot){
|
|||
buffer: d.screenshotBuffer,
|
||||
name: d.screenshotName+'.jpg',
|
||||
type: 'm.image',
|
||||
opttype: 'image/jpeg',
|
||||
info: {
|
||||
mimetype: 'image/jpeg',
|
||||
},
|
||||
opttype: 'image/jpeg',
|
||||
info: {
|
||||
mimetype: 'image/jpeg',
|
||||
},
|
||||
}
|
||||
],d.ke)
|
||||
}
|
||||
|
@ -125,7 +124,7 @@ module.exports = function(s,config,lang,getSnapshot){
|
|||
buffer: await fs.promises.readFile(videoPath),
|
||||
name: videoName,
|
||||
type: 'm.video',
|
||||
opttype: 'video/mp4',
|
||||
opttype: 'video/mp4',
|
||||
info: {
|
||||
mimetype: 'video/mp4',
|
||||
},
|
||||
|
@ -384,4 +383,4 @@ module.exports = function(s,config,lang,getSnapshot){
|
|||
console.log('Could not start Matrix bot, please run "npm install matrix-js-sdk" inside the Shinobi folder.')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue