Set undefined buffer.type as other

This commit is contained in:
Jeremy Mahieu 2020-04-12 17:56:14 +02:00
parent 4bf1d92ace
commit cf2e8b8ef2

View File

@ -90,7 +90,13 @@ models.service('models', ['$rootScope', '$filter', 'bufferResume', function($roo
// There are two kinds of types: bufferType (free vs formatted) and
// the kind of type that distinguishes queries from channels etc
var bufferType = message.type;
// If type is undefined set it as other to avoid later errors
var type = message.local_variables.type;
if (!type) {
type = 'other';
}
var indent = (['channel', 'private'].indexOf(type) >= 0);
var plugin = message.local_variables.plugin;