Report using eventId for now
Just grab a random one (latest)
This commit is contained in:
parent
c0f41f44e9
commit
21c5842f71
1 changed files with 9 additions and 5 deletions
|
|
@ -40,7 +40,6 @@
|
|||
</template>
|
||||
<script>
|
||||
import roomInfoMixin from "./roomInfoMixin";
|
||||
import * as utils from 'matrix-js-sdk/lib/utils';
|
||||
|
||||
export default {
|
||||
name: "ReportRoomDialog",
|
||||
|
|
@ -74,16 +73,21 @@ export default {
|
|||
|
||||
methods: {
|
||||
onReport() {
|
||||
const path = utils.encodeUri("/rooms/$roomId/report", {
|
||||
$roomId: this.room.roomId,
|
||||
});
|
||||
this.$matrix.matrixClient.http.authedRequest("POST", path, undefined, { reason: this.reason }, { prefix: "/_matrix/client/v3"})
|
||||
const events = this.room.getLiveTimeline().getEvents();
|
||||
if (events && events.length > 0) {
|
||||
const eventId = events[events.length - 1].getId();
|
||||
// const path = utils.encodeUri("/rooms/$roomId/report", {
|
||||
// $roomId: this.room.roomId,
|
||||
// });
|
||||
// this.$matrix.matrixClient.http.authedRequest("POST", path, undefined, { reason: this.reason }, { prefix: "/_matrix/client/v3"})
|
||||
this.$matrix.matrixClient.reportEvent(this.room.roomId, eventId, -100, this.reason)
|
||||
.then(() => {
|
||||
this.showDialog = false;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("Error reporting", err);
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue