@@ -564,13 +564,28 @@ def keypress(self, size, key):
564564 return super (MessagePrompt , self ).keypress (size , key )
565565
566566class Profile (urwid .Text ):
567- def __init__ (self , name , is_online = False ):
568- if is_online :
567+ def __init__ (self , name , is_online = False , is_snoozed = False ):
568+ self .name = name
569+ self .is_online = is_online
570+ self .is_snoozed = is_snoozed
571+ super (Profile , self ).__init__ (self .body )
572+
573+ @property
574+ def body (self ):
575+ if self .is_snoozed :
576+ presence_icon = ('presence_active' , ' {} ' .format (get_icon ('snooze' )))
577+ elif self .is_online :
569578 presence_icon = ('presence_active' , ' {} ' .format (get_icon ('online' )))
570579 else :
571580 presence_icon = ('presence_away' , ' {} ' .format (get_icon ('offline' )))
572- body = [presence_icon , name ]
573- super (Profile , self ).__init__ (body )
581+
582+ snooze_str = ' (snoozed) ' if self .is_snoozed else ''
583+
584+ return [presence_icon , self .name , snooze_str ]
585+
586+ def set_snooze (self , is_snoozed ):
587+ self .is_snoozed = is_snoozed
588+ self .set_text (self .body )
574589
575590class ProfileSideBar (urwid .AttrWrap ):
576591 def format_row (self , icon , text ):
@@ -622,6 +637,7 @@ class SideBar(urwid.Frame):
622637 signals = ['go_to_channel' ]
623638
624639 def __init__ (self , profile , channels = [], dms = [], title = '' ):
640+ self .profile = profile
625641 self .channels = channels
626642 self .dms = dms
627643 # Subcribe to receive message from channels to select them
0 commit comments