mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-08-11 00:20:54 +00:00
4.20.29
* Changed: Position the default `Reply to Message` in-line action after mod actions. * Fixed: The `Reply to Message` action not working as a User Context action. * Fixed: Twitch emotes appearing incorrectly within reply messages. * API Changed: `array_merge` settings now inherit their `default` values if the lowest profile has an inheritance point.
This commit is contained in:
parent
463c9f9a45
commit
c48423a7b2
6 changed files with 67 additions and 39 deletions
|
@ -65,11 +65,11 @@ export default class Actions extends Module {
|
|||
),
|
||||
|
||||
default: [
|
||||
{v: {action: 'reply', appearance: {type: 'icon', icon: 'ffz-i-reply'}, options: {}, display: {}}},
|
||||
{v: {action: 'ban', appearance: {type: 'icon', icon: 'ffz-i-block'}, options: {}, display: {mod: true, mod_icons: true, deleted: false}}},
|
||||
{v: {action: 'unban', appearance: {type: 'icon', icon: 'ffz-i-ok'}, options: {}, display: {mod: true, mod_icons: true, deleted: true}}},
|
||||
{v: {action: 'timeout', appearance: {type: 'icon', icon: 'ffz-i-clock'}, display: {mod: true, mod_icons: true}}},
|
||||
{v: {action: 'msg_delete', appearance: {type: 'icon', icon: 'ffz-i-trash'}, options: {}, display: {mod: true, mod_icons: true}}}
|
||||
{v: {action: 'msg_delete', appearance: {type: 'icon', icon: 'ffz-i-trash'}, options: {}, display: {mod: true, mod_icons: true}}},
|
||||
{v: {action: 'reply', appearance: {type: 'icon', icon: 'ffz-i-reply'}, options: {}, display: {}}}
|
||||
],
|
||||
|
||||
type: 'array_merge',
|
||||
|
@ -498,12 +498,14 @@ export default class Actions extends Module {
|
|||
if ( current_level < 3 )
|
||||
mod_icons = false;
|
||||
|
||||
const chat_line = line;
|
||||
|
||||
return this.renderPopup(target, (t, tip) => {
|
||||
const lines = [];
|
||||
let line = null;
|
||||
|
||||
const handle_click = event => {
|
||||
this.handleClick(event);
|
||||
this.handleClick(event, line);
|
||||
tip.hide();
|
||||
};
|
||||
|
||||
|
@ -599,6 +601,7 @@ export default class Actions extends Module {
|
|||
</div>);
|
||||
|
||||
out.ffz_message = msg;
|
||||
out.ffz_line = chat_line;
|
||||
return out;
|
||||
});
|
||||
}
|
||||
|
@ -723,11 +726,12 @@ export default class Actions extends Module {
|
|||
if ( ! definition )
|
||||
return null;
|
||||
|
||||
let user, room, message, loaded = false;
|
||||
let user, room, message, loaded = false, line;
|
||||
|
||||
if ( pds ) {
|
||||
if ( pds.source === 'msg' && parent.ffz_message ) {
|
||||
const msg = parent.ffz_message;
|
||||
line = parent.ffz_line;
|
||||
|
||||
loaded = true;
|
||||
user = msg.user ? {
|
||||
|
@ -749,8 +753,8 @@ export default class Actions extends Module {
|
|||
};
|
||||
|
||||
} else if ( pds.source === 'line' ) {
|
||||
const fine = this.resolve('site.fine'),
|
||||
line = fine && fine.searchParent(parent, n => n.props && n.props.message);
|
||||
const fine = this.resolve('site.fine');
|
||||
line = fine && fine.searchParent(parent, n => n.props && n.props.message);
|
||||
|
||||
if ( line && line.props && line.props.message ) {
|
||||
loaded = true;
|
||||
|
@ -792,7 +796,8 @@ export default class Actions extends Module {
|
|||
user,
|
||||
room,
|
||||
message,
|
||||
message_id: message ? message.id : null
|
||||
message_id: message ? message.id : null,
|
||||
line
|
||||
};
|
||||
|
||||
if ( definition.defaults )
|
||||
|
|
|
@ -36,15 +36,17 @@ export const reply = {
|
|||
return true;
|
||||
},
|
||||
|
||||
click(event) {
|
||||
const fine = this.resolve('site.fine'),
|
||||
click(event, data) {
|
||||
let line = data.line;
|
||||
if ( ! line ) {
|
||||
const fine = this.resolve('site.fine');
|
||||
line = fine ? fine.searchParent(event.target, n => n.setMessageTray && n.props && n.props.message) : null;
|
||||
}
|
||||
|
||||
if ( ! line )
|
||||
return;
|
||||
|
||||
line.ffzOpenReply();
|
||||
//line.setMessageTray(line.props.message, line.props.message.message);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1279,6 +1279,10 @@ export default class Chat extends Module {
|
|||
const emotes = {},
|
||||
chars = split_chars(msg.message);
|
||||
|
||||
let offset = 0;
|
||||
if ( msg.message && msg.messageBody && msg.message !== msg.messageBody )
|
||||
offset = chars.length - split_chars(msg.messageBody).length;
|
||||
|
||||
for(const key in msg.emotes)
|
||||
if ( has(msg.emotes, key) ) {
|
||||
const raw_emote = msg.emotes[key];
|
||||
|
@ -1286,7 +1290,7 @@ export default class Chat extends Module {
|
|||
return msg.ffz_emotes = msg.emotes;
|
||||
|
||||
const em = emotes[raw_emote.id] = emotes[raw_emote.id] || [];
|
||||
let idx = raw_emote.startIndex + 1;
|
||||
let idx = raw_emote.startIndex + 1 + offset;
|
||||
while(idx < chars.length) {
|
||||
if ( EMOTE_CHARS.test(chars[idx]) )
|
||||
break;
|
||||
|
@ -1295,7 +1299,7 @@ export default class Chat extends Module {
|
|||
}
|
||||
|
||||
em.push({
|
||||
startIndex: raw_emote.startIndex,
|
||||
startIndex: raw_emote.startIndex + offset,
|
||||
endIndex: idx - 1
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue