Skip to content

Commit

Permalink
chore: don't send enable and disable notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
damonto committed Jul 31, 2024
1 parent d712a58 commit 83b8295
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
8 changes: 2 additions & 6 deletions internal/app/handler/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"fmt"
"log/slog"
"strings"
"time"

"github.com/damonto/telegram-sms/internal/pkg/lpac"
Expand Down Expand Up @@ -209,11 +208,8 @@ func (h *ProfileHandler) handleActionEnable(c telebot.Context) error {
timeoutCtx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
if err := lpac.NewCmd(timeoutCtx, usbDevice).ProfileEnable(h.ICCID); err != nil {
// hack qmi: SimFileNotFound
if !strings.Contains(err.Error(), "SimFileNotFound") {
h.modem.Unlock()
return err
}
h.modem.Unlock()
return err
}
h.modem.Unlock()
// Sometimes the modem needs to be restarted to apply the changes.
Expand Down
4 changes: 1 addition & 3 deletions internal/pkg/lpac/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,7 @@ func (c *Cmd) ProfileDelete(ICCID string) error {
}

func (c *Cmd) ProfileEnable(ICCID string) error {
return c.sendNotificationAfterExecution(func() error {
return c.Run([]string{"profile", "enable", ICCID}, nil, nil)
}, true)
return c.Run([]string{"profile", "enable", ICCID}, nil, nil)
}

func (c *Cmd) ProfileSetNickname(ICCID string, nickname string) error {
Expand Down

0 comments on commit 83b8295

Please sign in to comment.