change to switch statement
This commit is contained in:
parent
0298c21668
commit
f67964b5fd
1 changed files with 3 additions and 3 deletions
6
main.go
6
main.go
|
@ -145,12 +145,12 @@ func (h *handler) HandleEvent(ctx context.Context, event *models.Event) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if event.Commit.Operation == models.CommitOperationCreate ||
|
switch event.Commit.Operation {
|
||||||
event.Commit.Operation == models.CommitOperationUpdate {
|
case models.CommitOperationCreate, models.CommitOperationUpdate:
|
||||||
h.bsky.Bluesky.Cfg.Cursor = event.TimeUS + 1 // +1 to not show same post
|
h.bsky.Bluesky.Cfg.Cursor = event.TimeUS + 1 // +1 to not show same post
|
||||||
bsky.PersistAuthSession(h.bsky.Bluesky.Cfg)
|
bsky.PersistAuthSession(h.bsky.Bluesky.Cfg)
|
||||||
h.ProcessPost(event)
|
h.ProcessPost(event)
|
||||||
} else if event.Commit.Operation == models.CommitOperationDelete {
|
case models.CommitOperationDelete:
|
||||||
h.bsky.Bluesky.Cfg.Cursor = event.TimeUS + 1 // +1 to not show same post
|
h.bsky.Bluesky.Cfg.Cursor = event.TimeUS + 1 // +1 to not show same post
|
||||||
bsky.PersistAuthSession(h.bsky.Bluesky.Cfg)
|
bsky.PersistAuthSession(h.bsky.Bluesky.Cfg)
|
||||||
r, e := h.bsky.Bluesky.GetTelegramData(event.Commit.RKey)
|
r, e := h.bsky.Bluesky.GetTelegramData(event.Commit.RKey)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue