mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
[feature] changed usertag in chat messages to user-slug
This commit is contained in:
parent
bcf93797f7
commit
24c6884b9a
@ -164,6 +164,12 @@ export default {
|
||||
},
|
||||
|
||||
async sendMessage(message) {
|
||||
//check for usersTag and change userid to username
|
||||
message.usersTag.forEach(userTag =>{
|
||||
let needle = `<usertag>${userTag.id}</usertag>`
|
||||
let replacement = `<usertag>@${userTag.name.replaceAll(" ","-").toLowerCase()}</usertag>`
|
||||
message.content = message.content.replaceAll(needle,replacement)
|
||||
})
|
||||
try {
|
||||
await this.$apollo.mutate({
|
||||
mutation: createMessageMutation(),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user