Skip to content

Commit

Permalink
don't send departure notifs to blocked users at signon
Browse files Browse the repository at this point in the history
  • Loading branch information
mk6i committed Dec 7, 2024
1 parent a4604bc commit 0189734
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions foodgroup/oservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -849,8 +849,8 @@ func (s OServiceServiceForBOS) ServiceRequest(ctx context.Context, sess *state.S
func (s OServiceServiceForBOS) ClientOnline(ctx context.Context, _ wire.SNAC_0x01_0x02_OServiceClientOnline, sess *state.Session) error {
sess.SetSignonComplete()

if err := s.buddyBroadcaster.BroadcastVisibility(ctx, sess, nil); err != nil {
return fmt.Errorf("unable to transition users: %w", err)
if err := s.buddyBroadcaster.BroadcastBuddyArrived(ctx, sess); err != nil {
return fmt.Errorf("unable to send buddy arrival notification: %w", err)
}

return nil
Expand Down
9 changes: 4 additions & 5 deletions foodgroup/oservice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1734,10 +1734,9 @@ func TestOServiceServiceForBOS_ClientOnline(t *testing.T) {
bodyIn: wire.SNAC_0x01_0x02_OServiceClientOnline{},
mockParams: mockParams{
buddyBroadcasterParams: buddyBroadcasterParams{
broadcastVisibilityParams: broadcastVisibilityParams{
broadcastBuddyArrivedParams: broadcastBuddyArrivedParams{
{
from: state.NewIdentScreenName("me"),
filter: nil,
screenName: state.NewIdentScreenName("me"),
},
},
},
Expand All @@ -1748,9 +1747,9 @@ func TestOServiceServiceForBOS_ClientOnline(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
buddyUpdateBroadcaster := newMockbuddyBroadcaster(t)
for _, params := range tt.mockParams.broadcastVisibilityParams {
for _, params := range tt.mockParams.broadcastBuddyArrivedParams {
buddyUpdateBroadcaster.EXPECT().
BroadcastVisibility(mock.Anything, matchSession(params.from), params.filter).
BroadcastBuddyArrived(mock.Anything, matchSession(params.screenName)).
Return(params.err)
}

Expand Down

0 comments on commit 0189734

Please sign in to comment.