File tree Expand file tree Collapse file tree
src/components/structures Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -197,9 +197,24 @@ module.exports = React.createClass({
197197 if ( ( this . state . phase == this . Phase . MemberList || this . state . phase === this . Phase . MemberInfo ) && this . props . roomId ) {
198198 var cli = MatrixClientPeg . get ( ) ;
199199 var room = cli . getRoom ( this . props . roomId ) ;
200+ var user_is_in_room ;
200201 if ( room ) {
201202 membersBadge = room . getJoinedMembers ( ) . length ;
203+ user_is_in_room = room . hasMembershipState (
204+ MatrixClientPeg . get ( ) . credentials . userId , 'join'
205+ ) ;
202206 }
207+
208+ if ( user_is_in_room ) {
209+ inviteGroup =
210+ < div className = "mx_RightPanel_invite" onClick = { this . onInviteButtonClick } >
211+ < div className = "mx_RightPanel_icon" >
212+ < TintableSvg src = "img/icon-invite-people.svg" width = "35" height = "35" />
213+ </ div >
214+ < div className = "mx_RightPanel_message" > Invite to this room</ div >
215+ </ div > ;
216+ }
217+
203218 }
204219
205220 if ( this . props . roomId ) {
@@ -221,14 +236,6 @@ module.exports = React.createClass({
221236 { notificationsHighlight }
222237 </ div >
223238 </ div > ;
224-
225- inviteGroup =
226- < div className = "mx_RightPanel_invite" onClick = { this . onInviteButtonClick } >
227- < div className = "mx_RightPanel_icon" >
228- < TintableSvg src = "img/icon-invite-people.svg" width = "35" height = "35" />
229- </ div >
230- < div className = "mx_RightPanel_message" > Invite to this room</ div >
231- </ div > ;
232239 }
233240
234241 if ( ! this . props . collapsed ) {
You can’t perform that action at this time.
0 commit comments