;
}
if (this.props.saving) {
var Spinner = sdk.getComponent("elements.Spinner");
spinner =
;
}
if (can_set_room_name) {
var RoomNameEditor = sdk.getComponent("rooms.RoomNameEditor");
name = ;
}
else {
var searchStatus;
// don't display the search count until the search completes and
// gives us a valid (possibly zero) searchCount.
if (this.props.searchInfo && this.props.searchInfo.searchCount !== undefined && this.props.searchInfo.searchCount !== null) {
searchStatus = (~{ this.props.searchInfo.searchCount } results)
;
}
// XXX: this is a bit inefficient - we could just compare room.name for 'Empty room'...
var settingsHint = false;
var members = this.props.room ? this.props.room.getJoinedMembers() : undefined;
if (members) {
if (members.length === 1 && members[0].userId === MatrixClientPeg.get().credentials.userId) {
var name = this.props.room.currentState.getStateEvents('m.room.name', '');
if (!name || !name.getContent().name) {
settingsHint = true;
}
}
}
var roomName = 'Join Room';
if (this.props.oobData && this.props.oobData.name) {
roomName = this.props.oobData.name;
} else if (this.props.room) {
roomName = this.props.room.name;
}
const emojiTextClasses = classNames('mx_RoomHeader_nametext', { mx_RoomHeader_settingsHint: settingsHint });
name =
{ roomName }
{ searchStatus }
;
}
if (can_set_room_topic) {
var RoomTopicEditor = sdk.getComponent("rooms.RoomTopicEditor");
topic_el = ;
} else {
var topic;
if (this.props.room) {
var ev = this.props.room.currentState.getStateEvents('m.room.topic', '');
if (ev) {
topic = ev.getContent().topic;
}
}
if (topic) {
topic_el = { topic }
;
}
}
var roomAvatar = null;
if (can_set_room_avatar) {
roomAvatar = (
);
}
else if (this.props.room || (this.props.oobData && this.props.oobData.name)) {
roomAvatar = (
);
}
var settings_button;
if (this.props.onSettingsClick) {
settings_button =
;
}
// var leave_button;
// if (this.props.onLeaveClick) {
// leave_button =
//
//
//
;
// }
var forget_button;
if (this.props.onForgetClick) {
forget_button =
;
}
let search_button;
if (this.props.onSearchClick && this.props.inRoom) {
search_button =
;
}
var rightPanel_buttons;
if (this.props.collapsedRhs) {
rightPanel_buttons =
;
}
var right_row;
if (!this.props.editing) {
right_row =
{ settings_button }
{ forget_button }
{ search_button }
{ rightPanel_buttons }
;
}
header =
{ roomAvatar }
{ name }
{ topic_el }
{spinner}
{save_button}
{cancel_button}
{right_row}
;
return (
{ header }
);
},
});