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>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import roomInfoMixin from "./roomInfoMixin";
|
import roomInfoMixin from "./roomInfoMixin";
|
||||||
import * as utils from 'matrix-js-sdk/lib/utils';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "ReportRoomDialog",
|
name: "ReportRoomDialog",
|
||||||
|
|
@ -74,16 +73,21 @@ export default {
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onReport() {
|
onReport() {
|
||||||
const path = utils.encodeUri("/rooms/$roomId/report", {
|
const events = this.room.getLiveTimeline().getEvents();
|
||||||
$roomId: this.room.roomId,
|
if (events && events.length > 0) {
|
||||||
});
|
const eventId = events[events.length - 1].getId();
|
||||||
this.$matrix.matrixClient.http.authedRequest("POST", path, undefined, { reason: this.reason }, { prefix: "/_matrix/client/v3"})
|
// 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(() => {
|
.then(() => {
|
||||||
this.showDialog = false;
|
this.showDialog = false;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log("Error reporting", err);
|
console.log("Error reporting", err);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue