Update.
This commit is contained in:
		
							parent
							
								
									2a5b9ad276
								
							
						
					
					
						commit
						81327a9e20
					
				| @ -47,14 +47,14 @@ class ChatInputComponent extends HTMLElement { | ||||
|     this.textarea.focus(); | ||||
|   }  | ||||
|     getAuthors(){ | ||||
| 	const uniqueAuthors = new Set() | ||||
| 	document.querySelectorAll('div.author').forEach(el=> | ||||
| 		{ | ||||
| 			uniqueAuthors.add(el.innerText.trim()) | ||||
| 		}) | ||||
| 		 | ||||
|     return Array.from(uniqueAuthors) | ||||
| } | ||||
|         let authors = [] | ||||
|         for (let i = 0; i < this.users.length; i++) { | ||||
|             authors.push(this.users[i].username) | ||||
|             authors.push(this.users[i].nick) | ||||
|         } | ||||
|         return authors | ||||
|          | ||||
|     } | ||||
|  extractMentions(text) { | ||||
|   const regex = /@([a-zA-Z0-9_]+)/g; | ||||
|   const mentions = []; | ||||
| @ -136,12 +136,16 @@ levenshteinDistance(a, b) { | ||||
|     app.rpc.getUser(null).then((user) => { | ||||
|         this.user=user | ||||
|     }) | ||||
| 
 | ||||
| 
 | ||||
|       const me = this; | ||||
|     this.liveType = this.getAttribute("live-type") === "true"; | ||||
|     this.liveTypeInterval = | ||||
|       parseInt(this.getAttribute("live-type-interval")) || 3; | ||||
|     this.channelUid = this.getAttribute("channel"); | ||||
|     this.messageUid = null; | ||||
|      | ||||
|     this.users = await app.rpc.getUsers(this.channelUid) | ||||
|       this.messageUid = null; | ||||
| 
 | ||||
|     this.classList.add("chat-input"); | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user