Skip to content

Commit

Permalink
make java aim client 1.1.19 work
Browse files Browse the repository at this point in the history
  • Loading branch information
mk6i committed Feb 9, 2025
1 parent 99c01d3 commit 9702696
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 0 deletions.
4 changes: 4 additions & 0 deletions foodgroup/buddy.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ func (s buddyNotifier) BroadcastBuddyArrived(ctx context.Context, sess *state.Se
Frame: wire.SNACFrame{
FoodGroup: wire.Buddy,
SubGroup: wire.BuddyArrived,
RequestID: wire.ReqIDFromServer,
},
Body: wire.SNAC_0x03_0x0B_BuddyArrived{
TLVUserInfo: userInfo,
Expand Down Expand Up @@ -181,6 +182,7 @@ func (s buddyNotifier) BroadcastBuddyDeparted(ctx context.Context, sess *state.S
Frame: wire.SNACFrame{
FoodGroup: wire.Buddy,
SubGroup: wire.BuddyDeparted,
RequestID: wire.ReqIDFromServer,
},
Body: wire.SNAC_0x03_0x0C_BuddyDeparted{
TLVUserInfo: wire.TLVUserInfo{
Expand Down Expand Up @@ -295,6 +297,7 @@ func (s buddyNotifier) unicastBuddyDeparted(ctx context.Context, from *state.Ses
Frame: wire.SNACFrame{
FoodGroup: wire.Buddy,
SubGroup: wire.BuddyDeparted,
RequestID: wire.ReqIDFromServer,
},
Body: wire.SNAC_0x03_0x0C_BuddyDeparted{
TLVUserInfo: wire.TLVUserInfo{
Expand All @@ -316,6 +319,7 @@ func (s buddyNotifier) unicastBuddyArrived(ctx context.Context, userInfo wire.TL
Frame: wire.SNACFrame{
FoodGroup: wire.Buddy,
SubGroup: wire.BuddyArrived,
RequestID: wire.ReqIDFromServer,
},
Body: wire.SNAC_0x03_0x0B_BuddyArrived{
TLVUserInfo: userInfo,
Expand Down
3 changes: 3 additions & 0 deletions foodgroup/buddy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ func TestBuddyService_BroadcastDeparture(t *testing.T) {
Frame: wire.SNACFrame{
FoodGroup: wire.Buddy,
SubGroup: wire.BuddyDeparted,
RequestID: wire.ReqIDFromServer,
},
Body: wire.SNAC_0x03_0x0C_BuddyDeparted{
TLVUserInfo: wire.TLVUserInfo{
Expand Down Expand Up @@ -872,6 +873,7 @@ func newBuddyDepartedNotif(me *state.Session) wire.SNACMessage {
Frame: wire.SNACFrame{
FoodGroup: wire.Buddy,
SubGroup: wire.BuddyDeparted,
RequestID: wire.ReqIDFromServer,
},
Body: wire.SNAC_0x03_0x0C_BuddyDeparted{
TLVUserInfo: wire.TLVUserInfo{
Expand All @@ -889,6 +891,7 @@ func newBuddyArrivedNotif(userInfo wire.TLVUserInfo) wire.SNACMessage {
Frame: wire.SNACFrame{
FoodGroup: wire.Buddy,
SubGroup: wire.BuddyArrived,
RequestID: wire.ReqIDFromServer,
},
Body: wire.SNAC_0x03_0x0B_BuddyArrived{
TLVUserInfo: userInfo,
Expand Down
1 change: 1 addition & 0 deletions foodgroup/icbm.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ func (s ICBMService) ChannelMsgToHost(ctx context.Context, sess *state.Session,
Frame: wire.SNACFrame{
FoodGroup: wire.ICBM,
SubGroup: wire.ICBMChannelMsgToClient,
RequestID: wire.ReqIDFromServer,
},
Body: clientIM,
})
Expand Down
2 changes: 2 additions & 0 deletions foodgroup/icbm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func TestICBMService_ChannelMsgToHost(t *testing.T) {
Frame: wire.SNACFrame{
FoodGroup: wire.ICBM,
SubGroup: wire.ICBMChannelMsgToClient,
RequestID: wire.ReqIDFromServer,
},
Body: wire.SNAC_0x04_0x07_ICBMChannelMsgToClient{
TLVUserInfo: newTestSession("sender-screen-name", sessOptWarning(10)).TLVUserInfo(),
Expand Down Expand Up @@ -150,6 +151,7 @@ func TestICBMService_ChannelMsgToHost(t *testing.T) {
Frame: wire.SNACFrame{
FoodGroup: wire.ICBM,
SubGroup: wire.ICBMChannelMsgToClient,
RequestID: wire.ReqIDFromServer,
},
Body: wire.SNAC_0x04_0x07_ICBMChannelMsgToClient{
TLVUserInfo: newTestSession("sender-screen-name", sessOptWarning(10)).TLVUserInfo(),
Expand Down
4 changes: 4 additions & 0 deletions foodgroup/oservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@ func (s OServiceService) HostOnline() wire.SNACMessage {
Frame: wire.SNACFrame{
FoodGroup: wire.OService,
SubGroup: wire.OServiceHostOnline,
RequestID: wire.ReqIDFromServer,
},
Body: wire.SNAC_0x01_0x03_OServiceHostOnline{
FoodGroups: s.foodGroups,
Expand Down Expand Up @@ -628,6 +629,9 @@ func NewOServiceServiceForBOS(
wire.OService,
wire.PermitDeny,
wire.UserLookup,
wire.Invite,
wire.Popup,
wire.Stats,
},
},
}
Expand Down
7 changes: 7 additions & 0 deletions foodgroup/oservice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1559,6 +1559,7 @@ func TestOServiceServiceForBOS_OServiceHostOnline(t *testing.T) {
Frame: wire.SNACFrame{
FoodGroup: wire.OService,
SubGroup: wire.OServiceHostOnline,
RequestID: wire.ReqIDFromServer,
},
Body: wire.SNAC_0x01_0x03_OServiceHostOnline{
FoodGroups: []uint16{
Expand All @@ -1572,6 +1573,9 @@ func TestOServiceServiceForBOS_OServiceHostOnline(t *testing.T) {
wire.OService,
wire.PermitDeny,
wire.UserLookup,
wire.Invite,
wire.Popup,
wire.Stats,
},
},
}
Expand All @@ -1587,6 +1591,7 @@ func TestOServiceServiceForChat_OServiceHostOnline(t *testing.T) {
Frame: wire.SNACFrame{
FoodGroup: wire.OService,
SubGroup: wire.OServiceHostOnline,
RequestID: wire.ReqIDFromServer,
},
Body: wire.SNAC_0x01_0x03_OServiceHostOnline{
FoodGroups: []uint16{
Expand Down Expand Up @@ -1901,6 +1906,7 @@ func TestOServiceServiceForChatNav_HostOnline(t *testing.T) {
Frame: wire.SNACFrame{
FoodGroup: wire.OService,
SubGroup: wire.OServiceHostOnline,
RequestID: wire.ReqIDFromServer,
},
Body: wire.SNAC_0x01_0x03_OServiceHostOnline{
FoodGroups: []uint16{
Expand All @@ -1921,6 +1927,7 @@ func TestOServiceServiceForAlert_HostOnline(t *testing.T) {
Frame: wire.SNACFrame{
FoodGroup: wire.OService,
SubGroup: wire.OServiceHostOnline,
RequestID: wire.ReqIDFromServer,
},
Body: wire.SNAC_0x01_0x03_OServiceHostOnline{
FoodGroups: []uint16{
Expand Down
6 changes: 6 additions & 0 deletions wire/frames.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ type SNACFrame struct {
RequestID uint32
}

// ReqIDFromServer is the SNAC frame Request ID value that indicates the SNAC
// is initiated by the server. Some clients, such as the Java AIM 1.1.19,
// completely fail to process some server SNACs if the high bit is not set on
// request ID.
const ReqIDFromServer = 1 << 31

type FLAPSignonFrame struct {
FLAPVersion uint32
TLVRestBlock
Expand Down

0 comments on commit 9702696

Please sign in to comment.