6
6
import urwid
7
7
8
8
from zulipterminal .config .keys import (
9
- HELP_CATEGORIES , KEY_BINDINGS , is_command_key ,
9
+ HELP_CATEGORIES , KEY_BINDINGS , is_command_key , keys_for_command ,
10
10
)
11
11
from zulipterminal .helper import Message , asynch , match_user
12
12
from zulipterminal .ui_tools .boxes import PanelSearchBox
@@ -904,6 +904,9 @@ def __init__(self, controller: Any, msg: Message) -> None:
904
904
('Date & Time' , time .ctime (msg ['timestamp' ])[:- 5 ]),
905
905
('Sender' , msg ['sender_full_name' ]),
906
906
('Sender\' s Email ID' , msg ['sender_email' ]),
907
+ ('Edit History' ,
908
+ 'Press ' + ', ' .join (map (repr , keys_for_command ('EDIT_HISTORY' )))
909
+ + ' to view' ),
907
910
('Reactions' , reactions if msg ['reactions' ] else '---None---' ),
908
911
])
909
912
@@ -925,3 +928,24 @@ def __init__(self, controller: Any, msg: Message) -> None:
925
928
for index , (field , data ) in enumerate (msg_info .items ())]
926
929
927
930
super ().__init__ (controller , msg_info_content , 'MSG_INFO' )
931
+
932
+ def keypress (self , size : urwid_Size , key : str ) -> str :
933
+ if is_command_key ('EDIT_HISTORY' , key ):
934
+ self .controller .show_edit_history (self .msg )
935
+ return super ().keypress (size , key )
936
+
937
+
938
+ class EditHistoryView (PopUpView ):
939
+ def __init__ (self , controller : Any , msg : Any ) -> None :
940
+ self .controller = controller
941
+ self .msg = msg
942
+ self .width = 64
943
+ self .height = 0
944
+ super ().__init__ (controller , [], 'MSG_INFO' )
945
+
946
+ def keypress (self , size : urwid_Size , key : str ) -> str :
947
+ if (is_command_key ('GO_BACK' , key )
948
+ or is_command_key ('EDIT_HISTORY' , key )):
949
+ self .controller .show_msg_info (self .msg )
950
+ return key
951
+ return super ().keypress (size , key )
0 commit comments