@@ -610,6 +610,40 @@ func (sm *SessionManager) execCommand(command Command) {
610
610
sm .uiHandler .PrintText ("added new members for " + groupId )
611
611
}
612
612
sm .uiHandler .PrintError (err )
613
+ case "remove" :
614
+ groupId := sm .currentReceiver
615
+ if strings .Index (groupId , GROUPSUFFIX ) < 0 {
616
+ sm .uiHandler .PrintText ("not a group" )
617
+ return
618
+ }
619
+ if ! checkParam (command .Params , 1 ) {
620
+ sm .printCommandUsage ("remove" , "[user-id[]" )
621
+ return
622
+ }
623
+ wac := sm .getConnection ()
624
+ var err error
625
+ _ , err = wac .RemoveMember (groupId , command .Params )
626
+ if err == nil {
627
+ sm .uiHandler .PrintText ("removed from " + groupId )
628
+ }
629
+ sm .uiHandler .PrintError (err )
630
+ case "removeadmin" :
631
+ groupId := sm .currentReceiver
632
+ if strings .Index (groupId , GROUPSUFFIX ) < 0 {
633
+ sm .uiHandler .PrintText ("not a group" )
634
+ return
635
+ }
636
+ if ! checkParam (command .Params , 1 ) {
637
+ sm .printCommandUsage ("removeadmin" , "[user-id[]" )
638
+ return
639
+ }
640
+ wac := sm .getConnection ()
641
+ var err error
642
+ _ , err = wac .RemoveAdmin (groupId , command .Params )
643
+ if err == nil {
644
+ sm .uiHandler .PrintText ("removed admin for " + groupId )
645
+ }
646
+ sm .uiHandler .PrintError (err )
613
647
case "admin" :
614
648
groupId := sm .currentReceiver
615
649
if strings .Index (groupId , GROUPSUFFIX ) < 0 {
0 commit comments