File tree Expand file tree Collapse file tree 4 files changed +17
-1
lines changed
Expand file tree Collapse file tree 4 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 5656 @edit-message =" editMessage"
5757 @delete-message =" deleteMessage"
5858 @open-file =" openFile"
59+ @open-user-tag =" openUserTag"
5960 @menu-action-handler =" menuActionHandler"
6061 @message-action-handler =" messageActionHandler"
6162 @send-message-reaction =" sendMessageReaction"
@@ -271,6 +272,9 @@ export default {
271272 openFile ({ message, action }) {
272273 this .$emit (' open-file' , { message, action })
273274 },
275+ openUserTag ({ user }) {
276+ this .$emit (' open-user-tag' , { user })
277+ },
274278 menuActionHandler (ev ) {
275279 this .$emit (' menu-action-handler' , {
276280 action: ev,
Original file line number Diff line number Diff line change @@ -74,7 +74,10 @@ export default {
7474 },
7575 openTag (message ) {
7676 if (! this .singleLine && this .checkType (message, ' tag' )) {
77- // TODO: emit event
77+ const user = this .users .find (
78+ u => message .value .indexOf (u .username ) !== - 1
79+ )
80+ this .$emit (' open-user-tag' , user)
7881 }
7982 }
8083 }
Original file line number Diff line number Diff line change 7878 :content =" message.content"
7979 :users =" roomUsers"
8080 :text-formatting =" textFormatting"
81+ @open-user-tag =" openUserTag"
8182 >
8283 <template v-slot :deleted-icon =" data " >
8384 <slot name =" deleted-icon" v-bind =" data" ></slot >
129130 :content =" message.content"
130131 :users =" roomUsers"
131132 :text-formatting =" textFormatting"
133+ @open-user-tag =" openUserTag"
132134 ></format-message >
133135 </div >
134136
@@ -457,6 +459,9 @@ export default {
457459 openFile (action ) {
458460 this .$emit (' open-file' , { message: this .message , action })
459461 },
462+ openUserTag (user ) {
463+ this .$emit (' open-user-tag' , { user })
464+ },
460465 messageActionHandler (action ) {
461466 this .closeOptions ()
462467 this .messageHover = false
Original file line number Diff line number Diff line change 137137 :hide-options =" hideOptions"
138138 @message-action-handler =" messageActionHandler"
139139 @open-file =" openFile"
140+ @open-user-tag =" openUserTag"
140141 @add-new-message =" addNewMessage"
141142 @send-message-reaction =" sendMessageReaction"
142143 @hide-options =" hideOptions = $event"
@@ -932,6 +933,9 @@ export default {
932933 openFile ({ message, action }) {
933934 this .$emit (' open-file' , { message, action })
934935 },
936+ openUserTag (user ) {
937+ this .$emit (' open-user-tag' , { user })
938+ },
935939 menuActionHandler (action ) {
936940 this .closeMenu ()
937941 this .$emit (' menu-action-handler' , action)
You can’t perform that action at this time.
0 commit comments