Skip to content

Commit

Permalink
append user info flag TLV to buddy departure events
Browse files Browse the repository at this point in the history
This is required for departure messages to work in ICQ 2000b.
  • Loading branch information
mk6i committed Aug 2, 2024
1 parent 83319d3 commit 71984cf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
11 changes: 9 additions & 2 deletions foodgroup/buddy.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,15 @@ func (s BuddyService) BroadcastBuddyDeparted(ctx context.Context, sess *state.Se
TLVUserInfo: wire.TLVUserInfo{
// don't include the TLV block, otherwise the AIM client fails
// to process the block event
ScreenName: string(sess.DisplayScreenName()),
ScreenName: sess.IdentScreenName().String(),
WarningLevel: sess.Warning(),
TLVBlock: wire.TLVBlock{
TLVList: wire.TLVList{
// this TLV needs to be set in order for departure
// events to work in ICQ
wire.NewTLV(wire.OServiceUserInfoUserFlags, uint8(0)),
},
},
},
},
})
Expand All @@ -234,7 +241,7 @@ func (s BuddyService) UnicastBuddyDeparted(ctx context.Context, from *state.Sess
TLVUserInfo: wire.TLVUserInfo{
// don't include the TLV block, otherwise the AIM client fails
// to process the block event
ScreenName: string(from.DisplayScreenName()),
ScreenName: from.IdentScreenName().String(),
WarningLevel: from.Warning(),
},
},
Expand Down
5 changes: 5 additions & 0 deletions foodgroup/buddy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,11 @@ func TestBuddyService_BroadcastDeparture(t *testing.T) {
TLVUserInfo: wire.TLVUserInfo{
ScreenName: "user_screen_name",
WarningLevel: 0,
TLVBlock: wire.TLVBlock{
TLVList: wire.TLVList{
wire.NewTLV(wire.OServiceUserInfoUserFlags, uint8(0)),
},
},
},
},
},
Expand Down

0 comments on commit 71984cf

Please sign in to comment.