1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-01 15:38:31 +00:00

4.0.0-rc20

* Added: Room Actions for Chat. Easily send canned messages or open relevant links.
* Changed: Refactor how action data is passed to in-line chat actions. Should perform better now, and also allow using the message text in actions.
* Changed: Blacklist a few errors from automatic error reporting.
* Fixed: Include the Squad Bar when calculating the player height for Portrait Mode.
* Fixed: Issue with rich content embeds breaking chat rendering when an error occurs loading their data.
* Fixed: Duplicate icon keys in chat action editor.
This commit is contained in:
SirStendec 2019-05-07 15:04:12 -04:00
parent c920b43e01
commit 5500b6eef3
14 changed files with 312 additions and 67 deletions

View file

@ -17,7 +17,7 @@ import Scroller from './scroller';
import ChatLine from './line';
import SettingsMenu from './settings_menu';
import EmoteMenu from './emote_menu';
import TabCompletion from './tab_completion';
import Input from './input';
const REGEX_EMOTES = {
@ -150,7 +150,7 @@ export default class ChatHook extends Module {
this.inject(ChatLine);
this.inject(SettingsMenu);
this.inject(EmoteMenu);
this.inject(TabCompletion);
this.inject(Input);
this.ChatService = this.fine.define(
'chat-service',
@ -560,25 +560,12 @@ export default class ChatHook extends Module {
this.ChatContainer.on('mount', this.containerMounted, this);
this.ChatContainer.on('unmount', this.removeRoom, this);
this.ChatContainer.on('receive-props', this.containerUpdated, this);
this.ChatContainer.on('update', this.containerUpdated, this);
this.ChatContainer.ready((cls, instances) => {
const t = this,
old_render = cls.prototype.render,
old_catch = cls.prototype.componentDidCatch;
// This is so stupid. I hate React. Why won't the events just fire
// like they should.
cls.prototype.render = function() {
try {
t.containerUpdated(this, this.props);
} catch(err) {
t.log.error(err);
}
return old_render.call(this);
}
// Try catching errors. With any luck, maybe we can
// recover from the error when we re-build?
cls.prototype.componentDidCatch = function(err, info) {
@ -685,7 +672,7 @@ export default class ChatHook extends Module {
if ( event.defaultPrevented || m.ffz_removed )
return;
} else if ( msg.type === types.ModerationAction ) {
} else if ( msg.type === types.ModerationAction && inst.markUserEventDeleted && inst.unsetModeratedUser ) {
//t.log.info('Moderation Action', msg);
if ( ! inst.props.isCurrentUserModerator )
return;
@ -724,7 +711,7 @@ export default class ChatHook extends Module {
return;
}
} else if ( msg.type === types.Moderation ) {
} else if ( msg.type === types.Moderation && inst.markUserEventDeleted && inst.unsetModeratedUser ) {
//t.log.info('Moderation', msg);
if ( inst.props.isCurrentUserModerator )
return;
@ -1540,6 +1527,8 @@ export default class ChatHook extends Module {
containerUpdated(cont, props) {
// If we don't have a room, or if the room ID doesn't match our ID
// then we need to just create a new Room because the chat room changed.
if ( ! cont._ffz_room || props.channelID != cont._ffz_room.id ) {
this.removeRoom(cont);
if ( cont._ffz_mounted )