1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-09-17 02:16:54 +00:00

3.5.422. Remove unnecessary logging line from chat-input. Tag messages from twitchnotify with special-message. Load the actual chat room in the background when VOD chat is open, thus loading emotes and generating CSS for badges and all of that. Fix VOD chat scroll throttling. Fix Clip URL generation. Closes #84.

This commit is contained in:
SirStendec 2017-01-27 23:28:30 -05:00
parent 8f75ca2d12
commit 8c5732cc5b
8 changed files with 52 additions and 23 deletions

View file

@ -1325,7 +1325,6 @@ FFZ.prototype.modify_chat_input = function(component) {
// If suggestions aren't visible... show them. And set that we
// triggered the suggestions with tab.
if ( ! this.get('ffz_suggestions_visible') ) {
f.log("Showing Suggestions from Tab");
this.ffzFetchNameSuggestions();
this.set('ffz_suggestions_visible', true);
this.ffzSetPartialWord();

View file

@ -995,6 +995,10 @@ FFZ.prototype._modify_chat_line = function(component, is_vod) {
return false;
}.property(),
ffzIsSpecialMessage: function() {
return this.get('hasSystemMsg') || this.get('msgObject.from') === 'twitchnotify';
}.property('hasSystemMsg', 'msgObject.from'),
ffzWasDeleted: function() {
return f.settings.prevent_clear && this.get("msgObject.ffz_deleted")
}.property("msgObject.ffz_deleted"),
@ -1016,7 +1020,7 @@ FFZ.prototype._modify_chat_subline = function(component, is_whisper) {
component.reopen({
classNameBindings: is_whisper ?
[':whisper-line', ':chat-line', 'isReceivedWhisper:whisper-incoming:whisper-outgoing'] :
["msgObject.style", "msgObject.isModerationMessage:moderation-message", "msgObject.ffz_has_mention:ffz-mentioned", "ffzWasDeleted:ffz-deleted", "ffzHasOldMessages:clearfix", "ffzHasOldMessages:ffz-has-deleted"],
["msgObject.isModerationMessage:moderation-message", "msgObject.ffz_has_mention:ffz-mentioned", "ffzIsSpecialMessage:special-message", "ffzWasDeleted:ffz-deleted", "ffzHasOldMessages:clearfix", "ffzHasOldMessages:ffz-has-deleted"],
attributeBindings: is_whisper ?
['msgObject.nonce:data-nonce', 'msgObject.tags.id:data-id', 'msgObject.from:data-sender'] :
["msgObject.tags.id:data-id", "msgObject.room:data-room", "msgObject.from:data-sender", "msgObject.deleted:data-deleted"],

View file

@ -1252,11 +1252,12 @@ FFZ.prototype._modify_room = function(room) {
ffzCheckDestroy: function() {
var Chat = utils.ember_lookup('controller:chat'),
current_vod = f._vodc && f._vodc.get('channel.name'),
user = f.get_user(),
room_id = this.get('id');
// Don't destroy the room if it's still relevant.
if ( (Chat && Chat.get('currentChannelRoom') === this) || (user && user.login === room_id) || (f._chatv && f._chatv._ffz_host === room_id) || (f.settings.pinned_rooms && f.settings.pinned_rooms.indexOf(room_id) !== -1) )
if ( (current_vod === room_id) || (Chat && Chat.get('currentChannelRoom') === this) || (user && user.login === room_id) || (f._chatv && f._chatv._ffz_host === room_id) || (f.settings.pinned_rooms && f.settings.pinned_rooms.indexOf(room_id) !== -1) )
return;
this.destroy();

View file

@ -74,10 +74,14 @@ FFZ.prototype.modify_vod_chat_display = function(component) {
this.ffzUpdateBadges();
// Load the room, if nencessary.
var room_id = this.get('channel.name');
if ( room_id && ! f.rooms[room_id] )
f.load_room(room_id);
// Load the room, if necessary.
var room_id = this.get('video.channel.id');
if ( room_id && ! f.rooms[room_id] ) {
// Load the room model.
f.log("Loading Room for VOD: " + room_id);
var Room = utils.ember_resolve('model:room');
Room && Room.findOne(room_id);
}
if ( ! f.has_bttv ) {
this.ffzFixStickyBottom();
@ -92,13 +96,21 @@ FFZ.prototype.modify_vod_chat_display = function(component) {
if ( f._vodc === this )
f._vodc = undefined;
var room_id = this.get('video.channel.id'),
room = f.rooms && f.rooms[room_id];
// We don't need the chat room anymore, in theory. This will
// check if the room is still important after a short delay.
if ( room && room.room )
room.room.ffzScheduleDestroy();
this.ffzDisableFreeze();
this.ffzRemoveKeyHook();
},
ffzUpdateBadges: function() {
var t = this,
channel_name = this.get('channel.name'),
channel_name = this.get('video.channel.id'),
owner_name = this.get('video.owner.name'),
owner_id = this.get('video.owner._id');
@ -122,7 +134,7 @@ FFZ.prototype.modify_vod_chat_display = function(component) {
if ( ! badges )
return this._super();
var room_id = this.get('channel.name'),
var room_id = this.get('video.channel.id'),
output = [];
for(var badge_id in badges) {
@ -140,6 +152,10 @@ FFZ.prototype.modify_vod_chat_display = function(component) {
val = this.get('stuckToBottom');
VODService && VODService.set("messageBufferSize", f.settings.scrollback_length + (val ? 0 : 150));
},
_scheduleScrollToBottom: function() {
this._scrollToBottom();
}
}, FFZ.HoverPause));