1
0

GODT-1910: fix GUI not being notified of SMTP SSL being turned on by ConfigureAppleMail.

This commit is contained in:
Xavier Michelon
2022-11-28 17:49:31 +01:00
parent 9881011043
commit 8e5040a357
2 changed files with 17 additions and 6 deletions

View File

@ -131,10 +131,17 @@ func (s *Service) RemoveUser(ctx context.Context, userID *wrapperspb.StringValue
func (s *Service) ConfigureUserAppleMail(ctx context.Context, request *ConfigureAppleMailRequest) (*emptypb.Empty, error) {
s.log.WithField("UserID", request.UserID).WithField("Address", request.Address).Debug("ConfigureUserAppleMail")
sslWasEnabled := s.bridge.GetSMTPSSL()
if err := s.bridge.ConfigureAppleMail(request.UserID, request.Address); err != nil {
s.log.WithField("userID", request.UserID).Error("Cannot configure AppleMail for user")
return nil, status.Error(codes.Internal, "Apple Mail config failed")
}
if s.bridge.GetSMTPSSL() != sslWasEnabled {
// we've changed SMTP SSL settings. This will happen if SSL was off and macOS >= Catalina. We must inform gRPC clients.
_ = s.SendEvent(NewMailServerSettingsChangedEvent(s.getMailServerSettings()))
}
return &emptypb.Empty{}, nil
}