@@ -21,6 +21,7 @@ import { User, UserEvent } from "matrix-js-sdk/src/models/user";
2121import { MatrixEvent } from "matrix-js-sdk/src/models/event" ;
2222import { EventType } from "matrix-js-sdk/src/@types/event" ;
2323import { JoinRule } from "matrix-js-sdk/src/@types/partials" ;
24+ import { UnstableValue } from "matrix-js-sdk/src/NamespacedValue" ;
2425
2526import RoomAvatar from "./RoomAvatar" ;
2627import NotificationBadge from '../rooms/NotificationBadge' ;
@@ -50,13 +51,16 @@ interface IState {
5051 icon : Icon ;
5152}
5253
54+ const BUSY_PRESENCE_NAME = new UnstableValue ( "busy" , "org.matrix.msc3026.busy" ) ;
55+
5356enum Icon {
5457 // Note: the names here are used in CSS class names
5558 None = "NONE" , // ... except this one
5659 Globe = "GLOBE" ,
5760 PresenceOnline = "ONLINE" ,
5861 PresenceAway = "AWAY" ,
5962 PresenceOffline = "OFFLINE" ,
63+ PresenceBusy = "BUSY" ,
6064}
6165
6266function tooltipText ( variant : Icon ) {
@@ -69,6 +73,8 @@ function tooltipText(variant: Icon) {
6973 return _t ( "Away" ) ;
7074 case Icon . PresenceOffline :
7175 return _t ( "Offline" ) ;
76+ case Icon . PresenceBusy :
77+ return _t ( "Busy" ) ;
7278 }
7379}
7480
@@ -141,7 +147,9 @@ export default class DecoratedRoomAvatar extends React.PureComponent<IProps, ISt
141147 let icon = Icon . None ;
142148
143149 const isOnline = this . dmUser . currentlyActive || this . dmUser . presence === 'online' ;
144- if ( isOnline ) {
150+ if ( BUSY_PRESENCE_NAME . matches ( this . dmUser . presence ) ) {
151+ icon = Icon . PresenceBusy ;
152+ } else if ( isOnline ) {
145153 icon = Icon . PresenceOnline ;
146154 } else if ( this . dmUser . presence === 'offline' ) {
147155 icon = Icon . PresenceOffline ;
0 commit comments