1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-07-25 20:18:31 +00:00

4.0.0-rc5

* Added: Remove messages entirely using Blocked Terms.
* Fixed: Position of emotes in locally echoed chat messages containing emoji.

Added a `chat:receive-message` event for processing incoming chat messages before they're added to the buffer.
This commit is contained in:
SirStendec 2018-07-14 14:13:28 -04:00
parent 84589231c8
commit f15d3c1d4f
7 changed files with 190 additions and 52 deletions

View file

@ -48,6 +48,31 @@
<option value="raw">{{ t('setting.terms.type.regex', 'Regex') }}</option>
</select>
</div>
<div v-if="removable" class="tw-flex-shrink-0 tw-mg-r-05 tw-tooltip-wrapper">
<button
v-if="editing"
:class="{active: edit_data.remove}"
class="tw-button ffz-directory-toggle-block"
@click="toggleRemove"
>
<span
:class="edit_data.remove ? 'ffz-i-eye-off' : 'ffz-i-eye'"
class="tw-button__text"
/>
</button>
<span
v-else-if="term.remove"
class="ffz-i-eye-off tw-pd-x-1"
/>
<div class="tw-tooltip tw-tooltip--down tw-tooltip--align-right">
<span v-if="display.remove">
{{ t('setting.terms.remove.on', 'Remove matching messages from chat.') }}
</span>
<span v-else>
{{ t('setting.terms.remove.off', 'Do not remove matching messages from chat.') }}
</span>
</div>
</div>
<div v-if="adding" class="tw-flex-shrink-0">
<button class="tw-button" @click="save">
<span class="tw-button__text">
@ -107,6 +132,8 @@ import safety from 'safe-regex';
import {deep_copy, glob_to_regex, escape_regex} from 'utilities/object';
let id = 0;
export default {
props: {
term: Object,
@ -114,6 +141,10 @@ export default {
type: Boolean,
default: false
},
removable: {
type: Boolean,
default: false
},
adding: {
type: Boolean,
default: false
@ -123,12 +154,14 @@ export default {
data() {
if ( this.adding )
return {
editor_id: id++,
deleting: false,
editing: true,
edit_data: deep_copy(this.term)
};
return {
editor_id: id++,
deleting: false,
editing: false,
edit_data: null
@ -136,8 +169,12 @@ export default {
},
computed: {
display() {
return this.editing ? this.edit_data : this.term;
},
is_valid() {
const data = this.editing ? this.edit_data : this.term,
const data = this.display,
t = data.t;
let v = data.v;
@ -157,7 +194,7 @@ export default {
},
is_safe() {
const data = this.editing ? this.edit_data : this.term,
const data = this.display,
t = data.t;
let v = data.v;
@ -195,6 +232,11 @@ export default {
this.edit_data = deep_copy(this.term);
},
toggleRemove() {
if ( this.editing )
this.edit_data.remove = ! this.edit_data.remove;
},
cancel() {
if ( this.adding ) {
this.edit_data = deep_copy(this.term);