diff --git a/foodgroup/icq.go b/foodgroup/icq.go index e4752ddc..6b024a30 100644 --- a/foodgroup/icq.go +++ b/foodgroup/icq.go @@ -702,7 +702,7 @@ func (s ICQService) reply(ctx context.Context, sess *state.Session, message wire FoodGroup: wire.ICQ, SubGroup: wire.ICQDBReply, }, - Body: wire.SNAC_0x0F_0x02_DBReply{ + Body: wire.SNAC_0x15_0x02_DBReply{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, message), diff --git a/foodgroup/icq_test.go b/foodgroup/icq_test.go index 4462253d..2d7546cf 100644 --- a/foodgroup/icq_test.go +++ b/foodgroup/icq_test.go @@ -131,7 +131,7 @@ func TestICQService_FindByDetails(t *testing.T) { FoodGroup: wire.ICQ, SubGroup: wire.ICQDBReply, }, - Body: wire.SNAC_0x0F_0x02_DBReply{ + Body: wire.SNAC_0x15_0x02_DBReply{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -168,7 +168,7 @@ func TestICQService_FindByDetails(t *testing.T) { FoodGroup: wire.ICQ, SubGroup: wire.ICQDBReply, }, - Body: wire.SNAC_0x0F_0x02_DBReply{ + Body: wire.SNAC_0x15_0x02_DBReply{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -308,7 +308,7 @@ func TestICQService_FindByEmail(t *testing.T) { FoodGroup: wire.ICQ, SubGroup: wire.ICQDBReply, }, - Body: wire.SNAC_0x0F_0x02_DBReply{ + Body: wire.SNAC_0x15_0x02_DBReply{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -444,7 +444,7 @@ func TestICQService_FindByUIN(t *testing.T) { FoodGroup: wire.ICQ, SubGroup: wire.ICQDBReply, }, - Body: wire.SNAC_0x0F_0x02_DBReply{ + Body: wire.SNAC_0x15_0x02_DBReply{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -602,7 +602,7 @@ func TestICQService_FindByWhitePages(t *testing.T) { FoodGroup: wire.ICQ, SubGroup: wire.ICQDBReply, }, - Body: wire.SNAC_0x0F_0x02_DBReply{ + Body: wire.SNAC_0x15_0x02_DBReply{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -639,7 +639,7 @@ func TestICQService_FindByWhitePages(t *testing.T) { FoodGroup: wire.ICQ, SubGroup: wire.ICQDBReply, }, - Body: wire.SNAC_0x0F_0x02_DBReply{ + Body: wire.SNAC_0x15_0x02_DBReply{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -834,7 +834,7 @@ func TestICQService_FullUserInfo(t *testing.T) { FoodGroup: wire.ICQ, SubGroup: wire.ICQDBReply, }, - Body: wire.SNAC_0x0F_0x02_DBReply{ + Body: wire.SNAC_0x15_0x02_DBReply{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -878,7 +878,7 @@ func TestICQService_FullUserInfo(t *testing.T) { FoodGroup: wire.ICQ, SubGroup: wire.ICQDBReply, }, - Body: wire.SNAC_0x0F_0x02_DBReply{ + Body: wire.SNAC_0x15_0x02_DBReply{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -919,7 +919,7 @@ func TestICQService_FullUserInfo(t *testing.T) { FoodGroup: wire.ICQ, SubGroup: wire.ICQDBReply, }, - Body: wire.SNAC_0x0F_0x02_DBReply{ + Body: wire.SNAC_0x15_0x02_DBReply{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -945,7 +945,7 @@ func TestICQService_FullUserInfo(t *testing.T) { FoodGroup: wire.ICQ, SubGroup: wire.ICQDBReply, }, - Body: wire.SNAC_0x0F_0x02_DBReply{ + Body: wire.SNAC_0x15_0x02_DBReply{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -971,7 +971,7 @@ func TestICQService_FullUserInfo(t *testing.T) { FoodGroup: wire.ICQ, SubGroup: wire.ICQDBReply, }, - Body: wire.SNAC_0x0F_0x02_DBReply{ + Body: wire.SNAC_0x15_0x02_DBReply{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -1011,7 +1011,7 @@ func TestICQService_FullUserInfo(t *testing.T) { FoodGroup: wire.ICQ, SubGroup: wire.ICQDBReply, }, - Body: wire.SNAC_0x0F_0x02_DBReply{ + Body: wire.SNAC_0x15_0x02_DBReply{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -1040,7 +1040,7 @@ func TestICQService_FullUserInfo(t *testing.T) { FoodGroup: wire.ICQ, SubGroup: wire.ICQDBReply, }, - Body: wire.SNAC_0x0F_0x02_DBReply{ + Body: wire.SNAC_0x15_0x02_DBReply{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -1087,7 +1087,7 @@ func TestICQService_FullUserInfo(t *testing.T) { FoodGroup: wire.ICQ, SubGroup: wire.ICQDBReply, }, - Body: wire.SNAC_0x0F_0x02_DBReply{ + Body: wire.SNAC_0x15_0x02_DBReply{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -1251,7 +1251,7 @@ func TestICQService_OfflineMsgReq(t *testing.T) { FoodGroup: wire.ICQ, SubGroup: wire.ICQDBReply, }, - Body: wire.SNAC_0x0F_0x02_DBReply{ + Body: wire.SNAC_0x15_0x02_DBReply{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -1283,7 +1283,7 @@ func TestICQService_OfflineMsgReq(t *testing.T) { FoodGroup: wire.ICQ, SubGroup: wire.ICQDBReply, }, - Body: wire.SNAC_0x0F_0x02_DBReply{ + Body: wire.SNAC_0x15_0x02_DBReply{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -1315,7 +1315,7 @@ func TestICQService_OfflineMsgReq(t *testing.T) { FoodGroup: wire.ICQ, SubGroup: wire.ICQDBReply, }, - Body: wire.SNAC_0x0F_0x02_DBReply{ + Body: wire.SNAC_0x15_0x02_DBReply{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -1438,7 +1438,7 @@ func TestICQService_SetAffiliations(t *testing.T) { FoodGroup: wire.ICQ, SubGroup: wire.ICQDBReply, }, - Body: wire.SNAC_0x0F_0x02_DBReply{ + Body: wire.SNAC_0x15_0x02_DBReply{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -1546,7 +1546,7 @@ func TestICQService_SetEmails(t *testing.T) { FoodGroup: wire.ICQ, SubGroup: wire.ICQDBReply, }, - Body: wire.SNAC_0x0F_0x02_DBReply{ + Body: wire.SNAC_0x15_0x02_DBReply{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -1649,7 +1649,7 @@ func TestICQService_SetBasicInfo(t *testing.T) { FoodGroup: wire.ICQ, SubGroup: wire.ICQDBReply, }, - Body: wire.SNAC_0x0F_0x02_DBReply{ + Body: wire.SNAC_0x15_0x02_DBReply{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -1760,7 +1760,7 @@ func TestICQService_SetInterests(t *testing.T) { FoodGroup: wire.ICQ, SubGroup: wire.ICQDBReply, }, - Body: wire.SNAC_0x0F_0x02_DBReply{ + Body: wire.SNAC_0x15_0x02_DBReply{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -1880,7 +1880,7 @@ func TestICQService_SetMoreInfo(t *testing.T) { FoodGroup: wire.ICQ, SubGroup: wire.ICQDBReply, }, - Body: wire.SNAC_0x0F_0x02_DBReply{ + Body: wire.SNAC_0x15_0x02_DBReply{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -1952,7 +1952,7 @@ func TestICQService_SetPermissions(t *testing.T) { FoodGroup: wire.ICQ, SubGroup: wire.ICQDBReply, }, - Body: wire.SNAC_0x0F_0x02_DBReply{ + Body: wire.SNAC_0x15_0x02_DBReply{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -2029,7 +2029,7 @@ func TestICQService_SetUserNotes(t *testing.T) { FoodGroup: wire.ICQ, SubGroup: wire.ICQDBReply, }, - Body: wire.SNAC_0x0F_0x02_DBReply{ + Body: wire.SNAC_0x15_0x02_DBReply{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -2135,7 +2135,7 @@ func TestICQService_SetWorkInfo(t *testing.T) { FoodGroup: wire.ICQ, SubGroup: wire.ICQDBReply, }, - Body: wire.SNAC_0x0F_0x02_DBReply{ + Body: wire.SNAC_0x15_0x02_DBReply{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -2235,7 +2235,7 @@ func TestICQService_ShortUserInfo(t *testing.T) { FoodGroup: wire.ICQ, SubGroup: wire.ICQDBReply, }, - Body: wire.SNAC_0x0F_0x02_DBReply{ + Body: wire.SNAC_0x15_0x02_DBReply{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -2328,7 +2328,7 @@ func TestICQService_XMLReqData(t *testing.T) { FoodGroup: wire.ICQ, SubGroup: wire.ICQDBReply, }, - Body: wire.SNAC_0x0F_0x02_DBReply{ + Body: wire.SNAC_0x15_0x02_DBReply{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ diff --git a/server/oscar/handler/icq.go b/server/oscar/handler/icq.go index e7d38eba..f7051133 100644 --- a/server/oscar/handler/icq.go +++ b/server/oscar/handler/icq.go @@ -55,7 +55,7 @@ type ICQHandler struct { } func (rt ICQHandler) DBQuery(ctx context.Context, sess *state.Session, inFrame wire.SNACFrame, r io.Reader, rw oscar.ResponseWriter) error { - inBody := wire.SNAC_0x0F_0x02_BQuery{} + inBody := wire.SNAC_0x15_0x02_BQuery{} if err := wire.UnmarshalBE(&inBody, r); err != nil { return err } diff --git a/server/oscar/handler/icq_test.go b/server/oscar/handler/icq_test.go index e602b32a..fc8e58a1 100644 --- a/server/oscar/handler/icq_test.go +++ b/server/oscar/handler/icq_test.go @@ -24,7 +24,7 @@ func TestICQHandler_DBQuery(t *testing.T) { ctx context.Context sess *state.Session inFrame wire.SNACFrame - inBody wire.SNAC_0x0F_0x02_BQuery + inBody wire.SNAC_0x15_0x02_BQuery rw oscar.ResponseWriter seq uint16 wantErr error @@ -61,7 +61,7 @@ func TestICQHandler_DBQuery(t *testing.T) { name: "MetaReqFullInfo - happy path", reqParams: reqParams{ sess: &state.Session{}, - inBody: wire.SNAC_0x0F_0x02_BQuery{ + inBody: wire.SNAC_0x15_0x02_BQuery{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -93,7 +93,7 @@ func TestICQHandler_DBQuery(t *testing.T) { name: "MetaReqShortInfo - happy path", reqParams: reqParams{ sess: &state.Session{}, - inBody: wire.SNAC_0x0F_0x02_BQuery{ + inBody: wire.SNAC_0x15_0x02_BQuery{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -125,7 +125,7 @@ func TestICQHandler_DBQuery(t *testing.T) { name: "MetaReqFullInfo2 - happy path", reqParams: reqParams{ sess: &state.Session{}, - inBody: wire.SNAC_0x0F_0x02_BQuery{ + inBody: wire.SNAC_0x15_0x02_BQuery{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -157,7 +157,7 @@ func TestICQHandler_DBQuery(t *testing.T) { name: "MetaReqXMLReq - happy path", reqParams: reqParams{ sess: &state.Session{}, - inBody: wire.SNAC_0x0F_0x02_BQuery{ + inBody: wire.SNAC_0x15_0x02_BQuery{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -189,7 +189,7 @@ func TestICQHandler_DBQuery(t *testing.T) { name: "MetaReqSetPermissions - happy path", reqParams: reqParams{ sess: &state.Session{}, - inBody: wire.SNAC_0x0F_0x02_BQuery{ + inBody: wire.SNAC_0x15_0x02_BQuery{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -221,7 +221,7 @@ func TestICQHandler_DBQuery(t *testing.T) { name: "MetaReqSearchByUIN - happy path", reqParams: reqParams{ sess: &state.Session{}, - inBody: wire.SNAC_0x0F_0x02_BQuery{ + inBody: wire.SNAC_0x15_0x02_BQuery{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -253,7 +253,7 @@ func TestICQHandler_DBQuery(t *testing.T) { name: "MetaReqSearchByEmail - happy path", reqParams: reqParams{ sess: &state.Session{}, - inBody: wire.SNAC_0x0F_0x02_BQuery{ + inBody: wire.SNAC_0x15_0x02_BQuery{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -285,7 +285,7 @@ func TestICQHandler_DBQuery(t *testing.T) { name: "MetaReqSearchByDetails - happy path", reqParams: reqParams{ sess: &state.Session{}, - inBody: wire.SNAC_0x0F_0x02_BQuery{ + inBody: wire.SNAC_0x15_0x02_BQuery{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -317,7 +317,7 @@ func TestICQHandler_DBQuery(t *testing.T) { name: "MetaReqSearchWhitePages - happy path", reqParams: reqParams{ sess: &state.Session{}, - inBody: wire.SNAC_0x0F_0x02_BQuery{ + inBody: wire.SNAC_0x15_0x02_BQuery{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -349,7 +349,7 @@ func TestICQHandler_DBQuery(t *testing.T) { name: "MetaReqSetBasicInfo - happy path", reqParams: reqParams{ sess: &state.Session{}, - inBody: wire.SNAC_0x0F_0x02_BQuery{ + inBody: wire.SNAC_0x15_0x02_BQuery{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -381,7 +381,7 @@ func TestICQHandler_DBQuery(t *testing.T) { name: "MetaReqSetWorkInfo - happy path", reqParams: reqParams{ sess: &state.Session{}, - inBody: wire.SNAC_0x0F_0x02_BQuery{ + inBody: wire.SNAC_0x15_0x02_BQuery{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -413,7 +413,7 @@ func TestICQHandler_DBQuery(t *testing.T) { name: "MetaReqSetMoreInfo - happy path", reqParams: reqParams{ sess: &state.Session{}, - inBody: wire.SNAC_0x0F_0x02_BQuery{ + inBody: wire.SNAC_0x15_0x02_BQuery{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -445,7 +445,7 @@ func TestICQHandler_DBQuery(t *testing.T) { name: "MetaReqSetNotes - happy path", reqParams: reqParams{ sess: &state.Session{}, - inBody: wire.SNAC_0x0F_0x02_BQuery{ + inBody: wire.SNAC_0x15_0x02_BQuery{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -477,7 +477,7 @@ func TestICQHandler_DBQuery(t *testing.T) { name: "MetaReqSetEmails - happy path", reqParams: reqParams{ sess: &state.Session{}, - inBody: wire.SNAC_0x0F_0x02_BQuery{ + inBody: wire.SNAC_0x15_0x02_BQuery{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -523,7 +523,7 @@ func TestICQHandler_DBQuery(t *testing.T) { name: "MetaReqSetInterests - happy path", reqParams: reqParams{ sess: &state.Session{}, - inBody: wire.SNAC_0x0F_0x02_BQuery{ + inBody: wire.SNAC_0x15_0x02_BQuery{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -569,7 +569,7 @@ func TestICQHandler_DBQuery(t *testing.T) { name: "MetaReqSetAffiliations - happy path", reqParams: reqParams{ sess: &state.Session{}, - inBody: wire.SNAC_0x0F_0x02_BQuery{ + inBody: wire.SNAC_0x15_0x02_BQuery{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -631,7 +631,7 @@ func TestICQHandler_DBQuery(t *testing.T) { name: "MetaReqStat - happy path", reqParams: reqParams{ sess: &state.Session{}, - inBody: wire.SNAC_0x0F_0x02_BQuery{ + inBody: wire.SNAC_0x15_0x02_BQuery{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -654,7 +654,7 @@ func TestICQHandler_DBQuery(t *testing.T) { name: "unknown metadata request subtype", reqParams: reqParams{ sess: &state.Session{}, - inBody: wire.SNAC_0x0F_0x02_BQuery{ + inBody: wire.SNAC_0x15_0x02_BQuery{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -678,7 +678,7 @@ func TestICQHandler_DBQuery(t *testing.T) { name: "OfflineMsgReq - happy path", reqParams: reqParams{ sess: &state.Session{}, - inBody: wire.SNAC_0x0F_0x02_BQuery{ + inBody: wire.SNAC_0x15_0x02_BQuery{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -702,7 +702,7 @@ func TestICQHandler_DBQuery(t *testing.T) { name: "DeleteMsgReq - happy path", reqParams: reqParams{ sess: &state.Session{}, - inBody: wire.SNAC_0x0F_0x02_BQuery{ + inBody: wire.SNAC_0x15_0x02_BQuery{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ @@ -726,7 +726,7 @@ func TestICQHandler_DBQuery(t *testing.T) { name: "unknown request type", reqParams: reqParams{ sess: &state.Session{}, - inBody: wire.SNAC_0x0F_0x02_BQuery{ + inBody: wire.SNAC_0x15_0x02_BQuery{ TLVRestBlock: wire.TLVRestBlock{ TLVList: wire.TLVList{ wire.NewTLV(wire.ICQTLVTagsMetadata, wire.ICQMessageReplyEnvelope{ diff --git a/wire/snacs.go b/wire/snacs.go index ff2ca4b1..babf72b4 100644 --- a/wire/snacs.go +++ b/wire/snacs.go @@ -961,707 +961,707 @@ type SNAC_0x0E_0x06_ChatChannelMsgToClient struct { } // -// 0x0F: ICQ +// 0x10: BART +// // const ( - ICQErr uint16 = 0x0001 - ICQDBQuery uint16 = 0x0002 - ICQDBReply uint16 = 0x0003 - - ICQTLVTagsMetadata uint16 = 0x01 - - ICQStatusCodeOK uint8 = 0x0A - ICQStatusCodeFail uint8 = 0x32 - ICQStatusCodeErr uint8 = 0x14 - - ICQDBQueryOfflineMsgReq uint16 = 0x003C - ICQDBQueryOfflineMsgReply uint16 = 0x0041 - ICQDBQueryOfflineMsgReplyLast uint16 = 0x0042 - ICQDBQueryDeleteMsgReq uint16 = 0x003E - ICQDBQueryMetaReq uint16 = 0x07D0 - ICQDBQueryMetaReply uint16 = 0x07DA + BARTTypesBuddyIconSmall uint16 = 0x00 + BARTTypesBuddyIcon uint16 = 0x01 + BARTTypesStatusStr uint16 = 0x02 + BARTTypesArriveSound uint16 = 0x03 + BARTTypesRichName uint16 = 0x04 + BARTTypesSuperIcon uint16 = 0x05 + BARTTypesRadioStation uint16 = 0x06 + BARTTypesSuperIconTrigger uint16 = 0x07 + BARTTypesStatusTextLink uint16 = 0x09 + BARTTypesLocation uint16 = 0x0B + BARTTypesBuddyIconBig uint16 = 0x0C + BARTTypesStatusTextTimestamp uint16 = 0x0D + BARTTypesCurrentAvtrack uint16 = 0x0F + BARTTypesDepartSound uint16 = 0x60 + BARTTypesImBackground uint16 = 0x80 + BARTTypesImChrome uint16 = 0x81 + BARTTypesImSkin uint16 = 0x82 + BARTTypesImSound uint16 = 0x83 + BARTTypesBadge uint16 = 0x84 + BARTTypesBadgeUrl uint16 = 0x85 + BARTTypesImInitialSound uint16 = 0x86 + BARTTypesFlashWallpaper uint16 = 0x88 + BARTTypesImmersiveWallpaper uint16 = 0x89 + BARTTypesBuddylistBackground uint16 = 0x100 + BARTTypesBuddylistImage uint16 = 0x101 + BARTTypesBuddylistSkin uint16 = 0x102 + BARTTypesSmileySet uint16 = 0x400 + BARTTypesEncrCertChain uint16 = 0x402 + BARTTypesSignCertChain uint16 = 0x403 + BARTTypesGatewayCert uint16 = 0x404 ) const ( - ICQUserFlagPublishEmailYes uint8 = 0 - ICQUserFlagPublishEmailNo uint8 = 1 + BARTErr uint16 = 0x0001 + BARTUploadQuery uint16 = 0x0002 + BARTUploadReply uint16 = 0x0003 + BARTDownloadQuery uint16 = 0x0004 + BARTDownloadReply uint16 = 0x0005 + BARTDownload2Query uint16 = 0x0006 + BARTDownload2Reply uint16 = 0x0007 ) const ( - ICQDBQueryMetaReqSetBasicInfo uint16 = 0x03EA - ICQDBQueryMetaReqSetWorkInfo uint16 = 0x03F3 - ICQDBQueryMetaReqSetMoreInfo uint16 = 0x03FD - ICQDBQueryMetaReqSetNotes uint16 = 0x0406 - ICQDBQueryMetaReqSetEmails uint16 = 0x040B - ICQDBQueryMetaReqSetInterests uint16 = 0x0410 - ICQDBQueryMetaReqSetAffiliations uint16 = 0x041A - ICQDBQueryMetaReqSetPermissions uint16 = 0x0424 - ICQDBQueryMetaReqShortInfo uint16 = 0x04BA - ICQDBQueryMetaReqFullInfo uint16 = 0x04B2 - ICQDBQueryMetaReqFullInfo2 uint16 = 0x04D0 - ICQDBQueryMetaReqSearchByDetails uint16 = 0x0515 - ICQDBQueryMetaReqSearchByUIN uint16 = 0x051F - ICQDBQueryMetaReqSearchByEmail uint16 = 0x0529 - ICQDBQueryMetaReqSearchWhitePages uint16 = 0x0533 - ICQDBQueryMetaReqXMLReq uint16 = 0x0898 - ICQDBQueryMetaReqStat0a8c uint16 = 0x0A8C - ICQDBQueryMetaReqStat0a96 uint16 = 0x0A96 - ICQDBQueryMetaReqStat0aaa uint16 = 0x0AAA - ICQDBQueryMetaReqStat0ab4 uint16 = 0x0AB4 - ICQDBQueryMetaReqStat0ab9 uint16 = 0x0AB9 - ICQDBQueryMetaReqStat0abe uint16 = 0x0ABE - ICQDBQueryMetaReqStat0ac8 uint16 = 0x0AC8 - ICQDBQueryMetaReqStat0acd uint16 = 0x0ACD - ICQDBQueryMetaReqStat0ad2 uint16 = 0x0AD2 - ICQDBQueryMetaReqStat0ad7 uint16 = 0x0AD7 - ICQDBQueryMetaReqStat0758 uint16 = 0x0758 + BARTFlagsKnown uint8 = 0x00 + BARTFlagsCustom uint8 = 0x01 + BARTFlagsUrl uint8 = 0x02 + BARTFlagsData uint8 = 0x04 + BARTFlagsUnknown uint8 = 0x40 + BARTFlagsRedirect uint8 = 0x80 + BARTFlagsBanned uint8 = 0xC0 +) - ICQDBQueryMetaReplySetBasicInfo uint16 = 0x0064 - ICQDBQueryMetaReplySetWorkInfo uint16 = 0x006E - ICQDBQueryMetaReplySetMoreInfo uint16 = 0x0078 - ICQDBQueryMetaReplySetNotes uint16 = 0x0082 - ICQDBQueryMetaReplySetEmails uint16 = 0x0087 - ICQDBQueryMetaReplySetInterests uint16 = 0x008C - ICQDBQueryMetaReplySetAffiliations uint16 = 0x0096 - ICQDBQueryMetaReplySetPermissions uint16 = 0x00A0 - ICQDBQueryMetaReplyBasicInfo uint16 = 0x00C8 - ICQDBQueryMetaReplyWorkInfo uint16 = 0x00D2 - ICQDBQueryMetaReplyMoreInfo uint16 = 0x00DC - ICQDBQueryMetaReplyNotes uint16 = 0x00E6 - ICQDBQueryMetaReplyExtEmailInfo uint16 = 0x00EB - ICQDBQueryMetaReplyInterests uint16 = 0x00F0 - ICQDBQueryMetaReplyAffiliations uint16 = 0x00FA - ICQDBQueryMetaReplyShortInfo uint16 = 0x0104 - ICQDBQueryMetaReplyHomePageCat uint16 = 0x010E - ICQDBQueryMetaReplyUserFound uint16 = 0x01A4 - ICQDBQueryMetaReplyLastUserFound uint16 = 0x01AE - ICQDBQueryMetaReplyXMLData uint16 = 0x08A2 +const ( + BARTReplyCodesSuccess uint8 = 0x00 + BARTReplyCodesInvalid uint8 = 0x01 + BARTReplyCodesNoCustom uint8 = 0x02 + BARTReplyCodesTooSmall uint8 = 0x03 + BARTReplyCodesTooBig uint8 = 0x04 + BARTReplyCodesInvalidType uint8 = 0x05 + BARTReplyCodesBanned uint8 = 0x06 + BARTReplyCodesNotfound uint8 = 0x07 ) -type SNAC_0x0F_0x02_BQuery struct { - TLVRestBlock +// GetClearIconHash returns an opaque value set in BARTID hash that indicates +// the user wants to clear their buddy icon. +func GetClearIconHash() []byte { + return []byte{0x02, 0x01, 0xd2, 0x04, 0x72} } -type ICQ_0x07D0_0x04BA_DBQueryMetaReqShortInfo struct { - UIN uint32 +// BARTInfo represents a BART feedbag item +type BARTInfo struct { + Flags uint8 + Hash []byte `oscar:"len_prefix=uint8"` } -type ICQ_0x07D0_0x0898_DBQueryMetaReqXMLReq struct { - XMLRequest string `oscar:"len_prefix=uint16,nullterm"` +// HasClearIconHash reports whether the BART ID hash contains the +// ClearIconHash sentinel value. +func (h BARTInfo) HasClearIconHash() bool { + return bytes.Equal(h.Hash, GetClearIconHash()) } -type ICQ_0x07D0_0x0424_DBQueryMetaReqSetPermissions struct { - Authorization uint8 // (1-required, 0-not required) - WebAware uint8 // webaware (0-no, 1-yes) - DCPerms uint8 // dc_perms (0-any, 1-contact, 2-authorization) - Unknown uint8 +type BARTID struct { + Type uint16 + BARTInfo } -type ICQ_0x07D0_0x051F_DBQueryMetaReqSearchByUIN struct { - UIN uint32 +type SNAC_0x10_0x02_BARTUploadQuery struct { + Type uint16 + Data []byte `oscar:"len_prefix=uint16"` } -type ICQ_0x07D0_0x0529_DBQueryMetaReqSearchByEmail struct { - Email string `oscar:"len_prefix=uint16,nullterm"` +type SNAC_0x10_0x03_BARTUploadReply struct { + Code uint8 + ID BARTID } -type ICQ_0x07D0_0x0515_DBQueryMetaReqSearchByDetails struct { - FirstName string `oscar:"len_prefix=uint16,nullterm"` - LastName string `oscar:"len_prefix=uint16,nullterm"` - NickName string `oscar:"len_prefix=uint16,nullterm"` +type SNAC_0x10_0x04_BARTDownloadQuery struct { + ScreenName string `oscar:"len_prefix=uint8"` + Command uint8 + BARTID } -type ICQ_0x07D0_0x0533_DBQueryMetaReqSearchWhitePages struct { - FirstName string `oscar:"len_prefix=uint16,nullterm"` - LastName string `oscar:"len_prefix=uint16,nullterm"` - Nickname string `oscar:"len_prefix=uint16,nullterm"` - Email string `oscar:"len_prefix=uint16,nullterm"` - MinAge uint16 - MaxAge uint16 - Gender uint8 - SpeakingLang uint8 - City string `oscar:"len_prefix=uint16,nullterm"` - State string `oscar:"len_prefix=uint16,nullterm"` - CountryCode uint16 - Company string `oscar:"len_prefix=uint16,nullterm"` - Department string `oscar:"len_prefix=uint16,nullterm"` - Position string `oscar:"len_prefix=uint16,nullterm"` - OccupationCode uint16 - PastCode uint16 - PastKeywords string `oscar:"len_prefix=uint16,nullterm"` - InterestsCode uint16 - InterestsKeyword string `oscar:"len_prefix=uint16,nullterm"` - AffiliationsCode uint16 - AffiliationsKeyword string `oscar:"len_prefix=uint16,nullterm"` - HomePageCode uint16 - HomePageKeywords string `oscar:"len_prefix=uint16,nullterm"` - SearchScope uint8 +type SNAC_0x10_0x05_BARTDownloadReply struct { + ScreenName string `oscar:"len_prefix=uint8"` + BARTID BARTID + Data []byte `oscar:"len_prefix=uint16"` } -type ICQ_0x07D0_0x03FD_DBQueryMetaReqSetMoreInfo struct { - Age uint8 // not used because age is calculated from birthdate - Gender uint16 - HomePageAddr string `oscar:"len_prefix=uint16,nullterm"` - BirthYear uint16 - BirthMonth uint8 - BirthDay uint8 - Lang1 uint8 - Lang2 uint8 - Lang3 uint8 -} +// 0x13: Feedbag +// -type ICQ_0x07D0_0x03F3_DBQueryMetaReqSetWorkInfo struct { - City string `oscar:"len_prefix=uint16,nullterm"` - State string `oscar:"len_prefix=uint16,nullterm"` - Phone string `oscar:"len_prefix=uint16,nullterm"` - Fax string `oscar:"len_prefix=uint16,nullterm"` - Address string `oscar:"len_prefix=uint16,nullterm"` - ZIP string `oscar:"len_prefix=uint16,nullterm"` - CountryCode uint16 - Company string `oscar:"len_prefix=uint16,nullterm"` - Department string `oscar:"len_prefix=uint16,nullterm"` - Position string `oscar:"len_prefix=uint16,nullterm"` - OccupationCode uint16 - WebPage string `oscar:"len_prefix=uint16,nullterm"` -} +const ( + FeedbagClassIdBuddy uint16 = 0x0000 + FeedbagClassIdGroup uint16 = 0x0001 + FeedbagClassIDPermit uint16 = 0x0002 + FeedbagClassIDDeny uint16 = 0x0003 + FeedbagClassIdPdinfo uint16 = 0x0004 + FeedbagClassIdBuddyPrefs uint16 = 0x0005 + FeedbagClassIdNonbuddy uint16 = 0x0006 + FeedbagClassIdTpaProvider uint16 = 0x0007 + FeedbagClassIdTpaSubscription uint16 = 0x0008 + FeedbagClassIdClientPrefs uint16 = 0x0009 + FeedbagClassIdStock uint16 = 0x000A + FeedbagClassIdWeather uint16 = 0x000B + FeedbagClassIdWatchList uint16 = 0x000D + FeedbagClassIdIgnoreList uint16 = 0x000E + FeedbagClassIdDateTime uint16 = 0x000F + FeedbagClassIdExternalUser uint16 = 0x0010 + FeedbagClassIdRootCreator uint16 = 0x0011 + FeedbagClassIdFish uint16 = 0x0012 + FeedbagClassIdImportTimestamp uint16 = 0x0013 + FeedbagClassIdBart uint16 = 0x0014 + FeedbagClassIdRbOrder uint16 = 0x0015 + FeedbagClassIdPersonality uint16 = 0x0016 + FeedbagClassIdAlProf uint16 = 0x0017 + FeedbagClassIdAlInfo uint16 = 0x0018 + FeedbagClassIdInteraction uint16 = 0x0019 + FeedbagClassIdVanityInfo uint16 = 0x001D + FeedbagClassIdFavoriteLocation uint16 = 0x001E + FeedbagClassIdBartPdinfo uint16 = 0x001F + FeedbagClassIdCustomEmoticons uint16 = 0x0024 + FeedbagClassIdMaxPredefined uint16 = 0x0024 + FeedbagClassIdXIcqStatusNote uint16 = 0x015C + FeedbagClassIdMin uint16 = 0x0400 -type ICQ_0x07D0_0x040B_DBQueryMetaReqSetEmails struct { - Emails []struct { - Publish uint8 - Email string `oscar:"len_prefix=uint16,nullterm"` - } `oscar:"count_prefix=uint8"` -} - -type ICQ_0x07D0_0x0406_DBQueryMetaReqSetNotes struct { - Notes string `oscar:"len_prefix=uint16,nullterm"` -} + FeedbagAttributesShared uint16 = 0x0064 + FeedbagAttributesInvited uint16 = 0x0065 + FeedbagAttributesPending uint16 = 0x0066 + FeedbagAttributesTimeT uint16 = 0x0067 + FeedbagAttributesDenied uint16 = 0x0068 + FeedbagAttributesSwimIndex uint16 = 0x0069 + FeedbagAttributesRecentBuddy uint16 = 0x006A + FeedbagAttributesAutoBot uint16 = 0x006B + FeedbagAttributesInteraction uint16 = 0x006D + FeedbagAttributesMegaBot uint16 = 0x006F + FeedbagAttributesOrder uint16 = 0x00C8 + FeedbagAttributesBuddyPrefs uint16 = 0x00C9 + FeedbagAttributesPdMode uint16 = 0x00CA + FeedbagAttributesPdMask uint16 = 0x00CB + FeedbagAttributesPdFlags uint16 = 0x00CC + FeedbagAttributesClientPrefs uint16 = 0x00CD + FeedbagAttributesLanguage uint16 = 0x00CE + FeedbagAttributesFishUri uint16 = 0x00CF + FeedbagAttributesWirelessPdMode uint16 = 0x00D0 + FeedbagAttributesWirelessIgnoreMode uint16 = 0x00D1 + FeedbagAttributesFishPdMode uint16 = 0x00D2 + FeedbagAttributesFishIgnoreMode uint16 = 0x00D3 + FeedbagAttributesCreateTime uint16 = 0x00D4 + FeedbagAttributesBartInfo uint16 = 0x00D5 + FeedbagAttributesBuddyPrefsValid uint16 = 0x00D6 + FeedbagAttributesBuddyPrefs2 uint16 = 0x00D7 + FeedbagAttributesBuddyPrefs2Valid uint16 = 0x00D8 + FeedbagAttributesBartList uint16 = 0x00D9 + FeedbagAttributesArriveSound uint16 = 0x012C + FeedbagAttributesLeaveSound uint16 = 0x012D + FeedbagAttributesImage uint16 = 0x012E + FeedbagAttributesColorBg uint16 = 0x012F + FeedbagAttributesColorFg uint16 = 0x0130 + FeedbagAttributesAlias uint16 = 0x0131 + FeedbagAttributesPassword uint16 = 0x0132 + FeedbagAttributesDisabled uint16 = 0x0133 + FeedbagAttributesCollapsed uint16 = 0x0134 + FeedbagAttributesUrl uint16 = 0x0135 + FeedbagAttributesActiveList uint16 = 0x0136 + FeedbagAttributesEmailAddr uint16 = 0x0137 + FeedbagAttributesPhoneNumber uint16 = 0x0138 + FeedbagAttributesCellPhoneNumber uint16 = 0x0139 + FeedbagAttributesSmsPhoneNumber uint16 = 0x013A + FeedbagAttributesWireless uint16 = 0x013B + FeedbagAttributesNote uint16 = 0x013C + FeedbagAttributesAlertPrefs uint16 = 0x013D + FeedbagAttributesBudalertSound uint16 = 0x013E + FeedbagAttributesStockalertValue uint16 = 0x013F + FeedbagAttributesTpalertEditUrl uint16 = 0x0140 + FeedbagAttributesTpalertDeleteUrl uint16 = 0x0141 + FeedbagAttributesTpprovMorealertsUrl uint16 = 0x0142 + FeedbagAttributesFish uint16 = 0x0143 + FeedbagAttributesXunconfirmedxLastAccess uint16 = 0x0145 + FeedbagAttributesImSent uint16 = 0x0150 + FeedbagAttributesOnlineTime uint16 = 0x0151 + FeedbagAttributesAwayMsg uint16 = 0x0152 + FeedbagAttributesImReceived uint16 = 0x0153 + FeedbagAttributesBuddyfeedView uint16 = 0x0154 + FeedbagAttributesWorkPhoneNumber uint16 = 0x0158 + FeedbagAttributesOtherPhoneNumber uint16 = 0x0159 + FeedbagAttributesWebPdMode uint16 = 0x015F + FeedbagAttributesFirstCreationTimeXc uint16 = 0x0167 + FeedbagAttributesPdModeXc uint16 = 0x016E -type ICQ_0x07D0_0x0410_DBQueryMetaReqSetInterests struct { - Interests []struct { - Code uint16 - Keyword string `oscar:"len_prefix=uint16,nullterm"` - } `oscar:"count_prefix=uint8"` -} + FeedbagRightsMaxClassAttrs uint16 = 0x02 + FeedbagRightsMaxItemAttrs uint16 = 0x03 + FeedbagRightsMaxItemsByClass uint16 = 0x04 + FeedbagRightsMaxClientItems uint16 = 0x05 + FeedbagRightsMaxItemNameLen uint16 = 0x06 + FeedbagRightsMaxRecentBuddies uint16 = 0x07 + FeedbagRightsInteractionBuddies uint16 = 0x08 + FeedbagRightsInteractionHalfLife uint16 = 0x09 + FeedbagRightsInteractionMaxScore uint16 = 0x0A + FeedbagRightsMaxUnknown0b uint16 = 0x0B + FeedbagRightsMaxBuddiesPerGroup uint16 = 0x0C + FeedbagRightsMaxMegaBots uint16 = 0x0D + FeedbagRightsMaxSmartGroups uint16 = 0x0E -type ICQ_0x07D0_0x041A_DBQueryMetaReqSetAffiliations struct { - PastAffiliations []struct { - Code uint16 - Keyword string `oscar:"len_prefix=uint16,nullterm"` - } `oscar:"count_prefix=uint8"` - Affiliations []struct { - Code uint16 - Keyword string `oscar:"len_prefix=uint16,nullterm"` - } `oscar:"count_prefix=uint8"` -} + FeedbagErr uint16 = 0x0001 + FeedbagRightsQuery uint16 = 0x0002 + FeedbagRightsReply uint16 = 0x0003 + FeedbagQuery uint16 = 0x0004 + FeedbagQueryIfModified uint16 = 0x0005 + FeedbagReply uint16 = 0x0006 + FeedbagUse uint16 = 0x0007 + FeedbagInsertItem uint16 = 0x0008 + FeedbagUpdateItem uint16 = 0x0009 + FeedbagDeleteItem uint16 = 0x000A + FeedbagInsertClass uint16 = 0x000B + FeedbagUpdateClass uint16 = 0x000C + FeedbagDeleteClass uint16 = 0x000D + FeedbagStatus uint16 = 0x000E + FeedbagReplyNotModified uint16 = 0x000F + FeedbagDeleteUser uint16 = 0x0010 + FeedbagStartCluster uint16 = 0x0011 + FeedbagEndCluster uint16 = 0x0012 + FeedbagAuthorizeBuddy uint16 = 0x0013 + FeedbagPreAuthorizeBuddy uint16 = 0x0014 + FeedbagPreAuthorizedBuddy uint16 = 0x0015 + FeedbagRemoveMe uint16 = 0x0016 + FeedbagRemoveMe2 uint16 = 0x0017 + FeedbagRequestAuthorizeToHost uint16 = 0x0018 + FeedbagRequestAuthorizeToClient uint16 = 0x0019 + FeedbagRespondAuthorizeToHost uint16 = 0x001A + FeedbagRespondAuthorizeToClient uint16 = 0x001B + FeedbagBuddyAdded uint16 = 0x001C + FeedbagRequestAuthorizeToBadog uint16 = 0x001D + FeedbagRespondAuthorizeToBadog uint16 = 0x001E + FeedbagBuddyAddedToBadog uint16 = 0x001F + FeedbagTestSnac uint16 = 0x0021 + FeedbagForwardMsg uint16 = 0x0022 + FeedbagIsAuthRequiredQuery uint16 = 0x0023 + FeedbagIsAuthRequiredReply uint16 = 0x0024 + FeedbagRecentBuddyUpdate uint16 = 0x0025 +) -type ICQ_0x07D0_0x03EA_DBQueryMetaReqSetBasicInfo struct { - Nickname string `oscar:"len_prefix=uint16,nullterm"` - FirstName string `oscar:"len_prefix=uint16,nullterm"` - LastName string `oscar:"len_prefix=uint16,nullterm"` - EmailAddress string `oscar:"len_prefix=uint16,nullterm"` - City string `oscar:"len_prefix=uint16,nullterm"` - State string `oscar:"len_prefix=uint16,nullterm"` - Phone string `oscar:"len_prefix=uint16,nullterm"` - Fax string `oscar:"len_prefix=uint16,nullterm"` - HomeAddress string `oscar:"len_prefix=uint16,nullterm"` - CellPhone string `oscar:"len_prefix=uint16,nullterm"` - ZIP string `oscar:"len_prefix=uint16,nullterm"` - CountryCode uint16 - GMTOffset uint8 - PublishEmail uint8 +type SNAC_0x13_0x02_FeedbagRightsQuery struct { + TLVRestBlock } -type SNAC_0x0F_0x02_DBReply struct { +type SNAC_0x13_0x03_FeedbagRightsReply struct { TLVRestBlock } -type ICQ_0x07DA_0x010E_DBQueryMetaReplyHomePageCat struct { - ICQMetadata - ReqSubType uint16 - Success uint8 - Enabled uint8 - CatCode uint16 - Keywords string `oscar:"len_prefix=uint16,nullterm"` - Unknown uint8 +type SNAC_0x13_0x05_FeedbagQueryIfModified struct { + LastUpdate uint32 + Count uint8 } -type ICQ_0x07DA_0x08A2_DBQueryMetaReplyXMLData struct { - ICQMetadata - ReqSubType uint16 - Success uint8 - XML string `oscar:"len_prefix=uint16,nullterm"` +type SNAC_0x13_0x06_FeedbagReply struct { + Version uint8 + Items []FeedbagItem `oscar:"count_prefix=uint16"` + LastUpdate uint32 } -type ICQ_0x07DA_0x00DC_DBQueryMetaReplyMoreInfo struct { - ICQMetadata - ReqSubType uint16 - Success uint8 - ICQ_0x07D0_0x03FD_DBQueryMetaReqSetMoreInfo - Unknown uint16 - City string `oscar:"len_prefix=uint16,nullterm"` - State string `oscar:"len_prefix=uint16,nullterm"` - CountryCode uint16 - TimeZone uint8 +type SNAC_0x13_0x08_FeedbagInsertItem struct { + Items []FeedbagItem } -type ICQ_0x07DA_0x00EB_DBQueryMetaReplyExtEmailInfo struct { - ICQMetadata - ReqSubType uint16 - Success uint8 - Emails []struct { - Flag uint8 // (0-publish, 1-don't) - Email string `oscar:"len_prefix=uint16,nullterm"` - } `oscar:"count_prefix=uint8"` +type SNAC_0x13_0x09_FeedbagUpdateItem struct { + Items []FeedbagItem } -type ICQ_0x07DA_0x00D2_DBQueryMetaReplyWorkInfo struct { - ICQMetadata - ReqSubType uint16 - Success uint8 - ICQ_0x07D0_0x03F3_DBQueryMetaReqSetWorkInfo +type SNAC_0x13_0x0A_FeedbagDeleteItem struct { + Items []FeedbagItem } -type ICQ_0x07DA_0x00F0_DBQueryMetaReplyInterests struct { - ICQMetadata - ReqSubType uint16 - Success uint8 - Interests []struct { - Code uint16 - Keyword string `oscar:"len_prefix=uint16,nullterm"` - } `oscar:"count_prefix=uint8"` +type SNAC_0x13_0x0E_FeedbagStatus struct { + Results []uint16 } -type ICQ_0x07DA_0x00E6_DBQueryMetaReplyNotes struct { - ICQMetadata - ReqSubType uint16 - Success uint8 - ICQ_0x07D0_0x0406_DBQueryMetaReqSetNotes +type SNAC_0x13_0x11_FeedbagStartCluster struct { + TLVRestBlock } -type ICQ_0x07DA_0x00FA_DBQueryMetaReplyAffiliations struct { - ICQMetadata - ReqSubType uint16 - Success uint8 - ICQ_0x07D0_0x041A_DBQueryMetaReqSetAffiliations -} +// +// 0x15: ICQ +// -type ICQ_0x07DA_0x00C8_DBQueryMetaReplyBasicInfo struct { - ICQMetadata - ReqSubType uint16 - Success uint8 - Nickname string `oscar:"len_prefix=uint16,nullterm"` - FirstName string `oscar:"len_prefix=uint16,nullterm"` - LastName string `oscar:"len_prefix=uint16,nullterm"` - Email string `oscar:"len_prefix=uint16,nullterm"` - City string `oscar:"len_prefix=uint16,nullterm"` - State string `oscar:"len_prefix=uint16,nullterm"` - Phone string `oscar:"len_prefix=uint16,nullterm"` - Fax string `oscar:"len_prefix=uint16,nullterm"` - Address string `oscar:"len_prefix=uint16,nullterm"` - CellPhone string `oscar:"len_prefix=uint16,nullterm"` - ZIP string `oscar:"len_prefix=uint16,nullterm"` - CountryCode uint16 - GMTOffset uint8 - AuthFlag uint8 - WebAware uint8 - DCPerms uint8 - PublishEmail uint8 -} +const ( + ICQErr uint16 = 0x0001 + ICQDBQuery uint16 = 0x0002 + ICQDBReply uint16 = 0x0003 -type ICQ_0x07DA_0x01AE_DBQueryMetaReplyLastUserFound struct { - ICQMetadata - ReqSubType uint16 - Success uint8 - Details ICQUserSearchRecord `oscar:"len_prefix=uint16"` - // LastMessageFooter is set only on the last message in the batch - LastMessageFooter *struct { - FoundUsersLeft uint32 - } `oscar:"optional"` -} - -// LastResult flags the message as the last message in the search results. -func (s *ICQ_0x07DA_0x01AE_DBQueryMetaReplyLastUserFound) LastResult() { - s.ReqSubType = ICQDBQueryMetaReplyLastUserFound - s.LastMessageFooter = &struct { - FoundUsersLeft uint32 - }{ - FoundUsersLeft: 0, - } -} - -type ICQ_0x07DA_0x0104_DBQueryMetaReplyShortInfo struct { - ICQMetadata - ReqSubType uint16 - Success uint8 - Nickname string `oscar:"len_prefix=uint16,nullterm"` - FirstName string `oscar:"len_prefix=uint16,nullterm"` - LastName string `oscar:"len_prefix=uint16,nullterm"` - Email string `oscar:"len_prefix=uint16,nullterm"` - Authorization uint8 - Unknown uint8 - Gender uint8 -} - -type ICQ_0x0041_DBQueryOfflineMsgReply struct { - ICQMetadata - SenderUIN uint32 - Year uint16 - Month uint8 - Day uint8 - Hour uint8 - Minute uint8 - MsgType uint8 - Flags uint8 - Message string `oscar:"len_prefix=uint16,nullterm"` -} - -type ICQ_0x0042_DBQueryOfflineMsgReplyLast struct { - ICQMetadata - DroppedMessages uint8 -} - -type ICQMetadataWithSubType struct { - ICQMetadata - Optional *struct { - ReqSubType uint16 - } `oscar:"optional"` -} - -type ICQMetadata struct { - UIN uint32 - ReqType uint16 - Seq uint16 -} - -// ICQMessageRequestEnvelope is a helper struct that provides syntactic sugar for -// unmarshaling an ICQ message into a little-endian byte array. -type ICQMessageRequestEnvelope struct { - Body []byte `oscar:"len_prefix=uint16"` -} - -// ICQMessageReplyEnvelope is a helper struct that provides syntactic sugar for -// marshaling an ICQ message into a little-endian byte array. -type ICQMessageReplyEnvelope struct { - Message any `oscar:"len_prefix=uint16"` -} - -type ICQUserSearchRecord struct { - UIN uint32 - Nickname string `oscar:"len_prefix=uint16,nullterm"` - FirstName string `oscar:"len_prefix=uint16,nullterm"` - LastName string `oscar:"len_prefix=uint16,nullterm"` - Email string `oscar:"len_prefix=uint16,nullterm"` - Authorization uint8 - OnlineStatus uint16 - Gender uint8 - Age uint16 -} + ICQTLVTagsMetadata uint16 = 0x01 -// -// 0x10: BART -// -// + ICQStatusCodeOK uint8 = 0x0A + ICQStatusCodeFail uint8 = 0x32 + ICQStatusCodeErr uint8 = 0x14 -const ( - BARTTypesBuddyIconSmall uint16 = 0x00 - BARTTypesBuddyIcon uint16 = 0x01 - BARTTypesStatusStr uint16 = 0x02 - BARTTypesArriveSound uint16 = 0x03 - BARTTypesRichName uint16 = 0x04 - BARTTypesSuperIcon uint16 = 0x05 - BARTTypesRadioStation uint16 = 0x06 - BARTTypesSuperIconTrigger uint16 = 0x07 - BARTTypesStatusTextLink uint16 = 0x09 - BARTTypesLocation uint16 = 0x0B - BARTTypesBuddyIconBig uint16 = 0x0C - BARTTypesStatusTextTimestamp uint16 = 0x0D - BARTTypesCurrentAvtrack uint16 = 0x0F - BARTTypesDepartSound uint16 = 0x60 - BARTTypesImBackground uint16 = 0x80 - BARTTypesImChrome uint16 = 0x81 - BARTTypesImSkin uint16 = 0x82 - BARTTypesImSound uint16 = 0x83 - BARTTypesBadge uint16 = 0x84 - BARTTypesBadgeUrl uint16 = 0x85 - BARTTypesImInitialSound uint16 = 0x86 - BARTTypesFlashWallpaper uint16 = 0x88 - BARTTypesImmersiveWallpaper uint16 = 0x89 - BARTTypesBuddylistBackground uint16 = 0x100 - BARTTypesBuddylistImage uint16 = 0x101 - BARTTypesBuddylistSkin uint16 = 0x102 - BARTTypesSmileySet uint16 = 0x400 - BARTTypesEncrCertChain uint16 = 0x402 - BARTTypesSignCertChain uint16 = 0x403 - BARTTypesGatewayCert uint16 = 0x404 + ICQDBQueryOfflineMsgReq uint16 = 0x003C + ICQDBQueryOfflineMsgReply uint16 = 0x0041 + ICQDBQueryOfflineMsgReplyLast uint16 = 0x0042 + ICQDBQueryDeleteMsgReq uint16 = 0x003E + ICQDBQueryMetaReq uint16 = 0x07D0 + ICQDBQueryMetaReply uint16 = 0x07DA ) const ( - BARTErr uint16 = 0x0001 - BARTUploadQuery uint16 = 0x0002 - BARTUploadReply uint16 = 0x0003 - BARTDownloadQuery uint16 = 0x0004 - BARTDownloadReply uint16 = 0x0005 - BARTDownload2Query uint16 = 0x0006 - BARTDownload2Reply uint16 = 0x0007 + ICQUserFlagPublishEmailYes uint8 = 0 + ICQUserFlagPublishEmailNo uint8 = 1 ) const ( - BARTFlagsKnown uint8 = 0x00 - BARTFlagsCustom uint8 = 0x01 - BARTFlagsUrl uint8 = 0x02 - BARTFlagsData uint8 = 0x04 - BARTFlagsUnknown uint8 = 0x40 - BARTFlagsRedirect uint8 = 0x80 - BARTFlagsBanned uint8 = 0xC0 -) + ICQDBQueryMetaReqSetBasicInfo uint16 = 0x03EA + ICQDBQueryMetaReqSetWorkInfo uint16 = 0x03F3 + ICQDBQueryMetaReqSetMoreInfo uint16 = 0x03FD + ICQDBQueryMetaReqSetNotes uint16 = 0x0406 + ICQDBQueryMetaReqSetEmails uint16 = 0x040B + ICQDBQueryMetaReqSetInterests uint16 = 0x0410 + ICQDBQueryMetaReqSetAffiliations uint16 = 0x041A + ICQDBQueryMetaReqSetPermissions uint16 = 0x0424 + ICQDBQueryMetaReqShortInfo uint16 = 0x04BA + ICQDBQueryMetaReqFullInfo uint16 = 0x04B2 + ICQDBQueryMetaReqFullInfo2 uint16 = 0x04D0 + ICQDBQueryMetaReqSearchByDetails uint16 = 0x0515 + ICQDBQueryMetaReqSearchByUIN uint16 = 0x051F + ICQDBQueryMetaReqSearchByEmail uint16 = 0x0529 + ICQDBQueryMetaReqSearchWhitePages uint16 = 0x0533 + ICQDBQueryMetaReqXMLReq uint16 = 0x0898 + ICQDBQueryMetaReqStat0a8c uint16 = 0x0A8C + ICQDBQueryMetaReqStat0a96 uint16 = 0x0A96 + ICQDBQueryMetaReqStat0aaa uint16 = 0x0AAA + ICQDBQueryMetaReqStat0ab4 uint16 = 0x0AB4 + ICQDBQueryMetaReqStat0ab9 uint16 = 0x0AB9 + ICQDBQueryMetaReqStat0abe uint16 = 0x0ABE + ICQDBQueryMetaReqStat0ac8 uint16 = 0x0AC8 + ICQDBQueryMetaReqStat0acd uint16 = 0x0ACD + ICQDBQueryMetaReqStat0ad2 uint16 = 0x0AD2 + ICQDBQueryMetaReqStat0ad7 uint16 = 0x0AD7 + ICQDBQueryMetaReqStat0758 uint16 = 0x0758 -const ( - BARTReplyCodesSuccess uint8 = 0x00 - BARTReplyCodesInvalid uint8 = 0x01 - BARTReplyCodesNoCustom uint8 = 0x02 - BARTReplyCodesTooSmall uint8 = 0x03 - BARTReplyCodesTooBig uint8 = 0x04 - BARTReplyCodesInvalidType uint8 = 0x05 - BARTReplyCodesBanned uint8 = 0x06 - BARTReplyCodesNotfound uint8 = 0x07 + ICQDBQueryMetaReplySetBasicInfo uint16 = 0x0064 + ICQDBQueryMetaReplySetWorkInfo uint16 = 0x006E + ICQDBQueryMetaReplySetMoreInfo uint16 = 0x0078 + ICQDBQueryMetaReplySetNotes uint16 = 0x0082 + ICQDBQueryMetaReplySetEmails uint16 = 0x0087 + ICQDBQueryMetaReplySetInterests uint16 = 0x008C + ICQDBQueryMetaReplySetAffiliations uint16 = 0x0096 + ICQDBQueryMetaReplySetPermissions uint16 = 0x00A0 + ICQDBQueryMetaReplyBasicInfo uint16 = 0x00C8 + ICQDBQueryMetaReplyWorkInfo uint16 = 0x00D2 + ICQDBQueryMetaReplyMoreInfo uint16 = 0x00DC + ICQDBQueryMetaReplyNotes uint16 = 0x00E6 + ICQDBQueryMetaReplyExtEmailInfo uint16 = 0x00EB + ICQDBQueryMetaReplyInterests uint16 = 0x00F0 + ICQDBQueryMetaReplyAffiliations uint16 = 0x00FA + ICQDBQueryMetaReplyShortInfo uint16 = 0x0104 + ICQDBQueryMetaReplyHomePageCat uint16 = 0x010E + ICQDBQueryMetaReplyUserFound uint16 = 0x01A4 + ICQDBQueryMetaReplyLastUserFound uint16 = 0x01AE + ICQDBQueryMetaReplyXMLData uint16 = 0x08A2 ) -// GetClearIconHash returns an opaque value set in BARTID hash that indicates -// the user wants to clear their buddy icon. -func GetClearIconHash() []byte { - return []byte{0x02, 0x01, 0xd2, 0x04, 0x72} -} - -// BARTInfo represents a BART feedbag item -type BARTInfo struct { - Flags uint8 - Hash []byte `oscar:"len_prefix=uint8"` +type SNAC_0x15_0x02_BQuery struct { + TLVRestBlock } -// HasClearIconHash reports whether the BART ID hash contains the -// ClearIconHash sentinel value. -func (h BARTInfo) HasClearIconHash() bool { - return bytes.Equal(h.Hash, GetClearIconHash()) +type ICQ_0x07D0_0x04BA_DBQueryMetaReqShortInfo struct { + UIN uint32 } -type BARTID struct { - Type uint16 - BARTInfo +type ICQ_0x07D0_0x0898_DBQueryMetaReqXMLReq struct { + XMLRequest string `oscar:"len_prefix=uint16,nullterm"` } -type SNAC_0x10_0x02_BARTUploadQuery struct { - Type uint16 - Data []byte `oscar:"len_prefix=uint16"` +type ICQ_0x07D0_0x0424_DBQueryMetaReqSetPermissions struct { + Authorization uint8 // (1-required, 0-not required) + WebAware uint8 // webaware (0-no, 1-yes) + DCPerms uint8 // dc_perms (0-any, 1-contact, 2-authorization) + Unknown uint8 } -type SNAC_0x10_0x03_BARTUploadReply struct { - Code uint8 - ID BARTID +type ICQ_0x07D0_0x051F_DBQueryMetaReqSearchByUIN struct { + UIN uint32 } -type SNAC_0x10_0x04_BARTDownloadQuery struct { - ScreenName string `oscar:"len_prefix=uint8"` - Command uint8 - BARTID +type ICQ_0x07D0_0x0529_DBQueryMetaReqSearchByEmail struct { + Email string `oscar:"len_prefix=uint16,nullterm"` } -type SNAC_0x10_0x05_BARTDownloadReply struct { - ScreenName string `oscar:"len_prefix=uint8"` - BARTID BARTID - Data []byte `oscar:"len_prefix=uint16"` +type ICQ_0x07D0_0x0515_DBQueryMetaReqSearchByDetails struct { + FirstName string `oscar:"len_prefix=uint16,nullterm"` + LastName string `oscar:"len_prefix=uint16,nullterm"` + NickName string `oscar:"len_prefix=uint16,nullterm"` } -// 0x13: Feedbag -// - -const ( - FeedbagClassIdBuddy uint16 = 0x0000 - FeedbagClassIdGroup uint16 = 0x0001 - FeedbagClassIDPermit uint16 = 0x0002 - FeedbagClassIDDeny uint16 = 0x0003 - FeedbagClassIdPdinfo uint16 = 0x0004 - FeedbagClassIdBuddyPrefs uint16 = 0x0005 - FeedbagClassIdNonbuddy uint16 = 0x0006 - FeedbagClassIdTpaProvider uint16 = 0x0007 - FeedbagClassIdTpaSubscription uint16 = 0x0008 - FeedbagClassIdClientPrefs uint16 = 0x0009 - FeedbagClassIdStock uint16 = 0x000A - FeedbagClassIdWeather uint16 = 0x000B - FeedbagClassIdWatchList uint16 = 0x000D - FeedbagClassIdIgnoreList uint16 = 0x000E - FeedbagClassIdDateTime uint16 = 0x000F - FeedbagClassIdExternalUser uint16 = 0x0010 - FeedbagClassIdRootCreator uint16 = 0x0011 - FeedbagClassIdFish uint16 = 0x0012 - FeedbagClassIdImportTimestamp uint16 = 0x0013 - FeedbagClassIdBart uint16 = 0x0014 - FeedbagClassIdRbOrder uint16 = 0x0015 - FeedbagClassIdPersonality uint16 = 0x0016 - FeedbagClassIdAlProf uint16 = 0x0017 - FeedbagClassIdAlInfo uint16 = 0x0018 - FeedbagClassIdInteraction uint16 = 0x0019 - FeedbagClassIdVanityInfo uint16 = 0x001D - FeedbagClassIdFavoriteLocation uint16 = 0x001E - FeedbagClassIdBartPdinfo uint16 = 0x001F - FeedbagClassIdCustomEmoticons uint16 = 0x0024 - FeedbagClassIdMaxPredefined uint16 = 0x0024 - FeedbagClassIdXIcqStatusNote uint16 = 0x015C - FeedbagClassIdMin uint16 = 0x0400 +type ICQ_0x07D0_0x0533_DBQueryMetaReqSearchWhitePages struct { + FirstName string `oscar:"len_prefix=uint16,nullterm"` + LastName string `oscar:"len_prefix=uint16,nullterm"` + Nickname string `oscar:"len_prefix=uint16,nullterm"` + Email string `oscar:"len_prefix=uint16,nullterm"` + MinAge uint16 + MaxAge uint16 + Gender uint8 + SpeakingLang uint8 + City string `oscar:"len_prefix=uint16,nullterm"` + State string `oscar:"len_prefix=uint16,nullterm"` + CountryCode uint16 + Company string `oscar:"len_prefix=uint16,nullterm"` + Department string `oscar:"len_prefix=uint16,nullterm"` + Position string `oscar:"len_prefix=uint16,nullterm"` + OccupationCode uint16 + PastCode uint16 + PastKeywords string `oscar:"len_prefix=uint16,nullterm"` + InterestsCode uint16 + InterestsKeyword string `oscar:"len_prefix=uint16,nullterm"` + AffiliationsCode uint16 + AffiliationsKeyword string `oscar:"len_prefix=uint16,nullterm"` + HomePageCode uint16 + HomePageKeywords string `oscar:"len_prefix=uint16,nullterm"` + SearchScope uint8 +} - FeedbagAttributesShared uint16 = 0x0064 - FeedbagAttributesInvited uint16 = 0x0065 - FeedbagAttributesPending uint16 = 0x0066 - FeedbagAttributesTimeT uint16 = 0x0067 - FeedbagAttributesDenied uint16 = 0x0068 - FeedbagAttributesSwimIndex uint16 = 0x0069 - FeedbagAttributesRecentBuddy uint16 = 0x006A - FeedbagAttributesAutoBot uint16 = 0x006B - FeedbagAttributesInteraction uint16 = 0x006D - FeedbagAttributesMegaBot uint16 = 0x006F - FeedbagAttributesOrder uint16 = 0x00C8 - FeedbagAttributesBuddyPrefs uint16 = 0x00C9 - FeedbagAttributesPdMode uint16 = 0x00CA - FeedbagAttributesPdMask uint16 = 0x00CB - FeedbagAttributesPdFlags uint16 = 0x00CC - FeedbagAttributesClientPrefs uint16 = 0x00CD - FeedbagAttributesLanguage uint16 = 0x00CE - FeedbagAttributesFishUri uint16 = 0x00CF - FeedbagAttributesWirelessPdMode uint16 = 0x00D0 - FeedbagAttributesWirelessIgnoreMode uint16 = 0x00D1 - FeedbagAttributesFishPdMode uint16 = 0x00D2 - FeedbagAttributesFishIgnoreMode uint16 = 0x00D3 - FeedbagAttributesCreateTime uint16 = 0x00D4 - FeedbagAttributesBartInfo uint16 = 0x00D5 - FeedbagAttributesBuddyPrefsValid uint16 = 0x00D6 - FeedbagAttributesBuddyPrefs2 uint16 = 0x00D7 - FeedbagAttributesBuddyPrefs2Valid uint16 = 0x00D8 - FeedbagAttributesBartList uint16 = 0x00D9 - FeedbagAttributesArriveSound uint16 = 0x012C - FeedbagAttributesLeaveSound uint16 = 0x012D - FeedbagAttributesImage uint16 = 0x012E - FeedbagAttributesColorBg uint16 = 0x012F - FeedbagAttributesColorFg uint16 = 0x0130 - FeedbagAttributesAlias uint16 = 0x0131 - FeedbagAttributesPassword uint16 = 0x0132 - FeedbagAttributesDisabled uint16 = 0x0133 - FeedbagAttributesCollapsed uint16 = 0x0134 - FeedbagAttributesUrl uint16 = 0x0135 - FeedbagAttributesActiveList uint16 = 0x0136 - FeedbagAttributesEmailAddr uint16 = 0x0137 - FeedbagAttributesPhoneNumber uint16 = 0x0138 - FeedbagAttributesCellPhoneNumber uint16 = 0x0139 - FeedbagAttributesSmsPhoneNumber uint16 = 0x013A - FeedbagAttributesWireless uint16 = 0x013B - FeedbagAttributesNote uint16 = 0x013C - FeedbagAttributesAlertPrefs uint16 = 0x013D - FeedbagAttributesBudalertSound uint16 = 0x013E - FeedbagAttributesStockalertValue uint16 = 0x013F - FeedbagAttributesTpalertEditUrl uint16 = 0x0140 - FeedbagAttributesTpalertDeleteUrl uint16 = 0x0141 - FeedbagAttributesTpprovMorealertsUrl uint16 = 0x0142 - FeedbagAttributesFish uint16 = 0x0143 - FeedbagAttributesXunconfirmedxLastAccess uint16 = 0x0145 - FeedbagAttributesImSent uint16 = 0x0150 - FeedbagAttributesOnlineTime uint16 = 0x0151 - FeedbagAttributesAwayMsg uint16 = 0x0152 - FeedbagAttributesImReceived uint16 = 0x0153 - FeedbagAttributesBuddyfeedView uint16 = 0x0154 - FeedbagAttributesWorkPhoneNumber uint16 = 0x0158 - FeedbagAttributesOtherPhoneNumber uint16 = 0x0159 - FeedbagAttributesWebPdMode uint16 = 0x015F - FeedbagAttributesFirstCreationTimeXc uint16 = 0x0167 - FeedbagAttributesPdModeXc uint16 = 0x016E +type ICQ_0x07D0_0x03FD_DBQueryMetaReqSetMoreInfo struct { + Age uint8 // not used because age is calculated from birthdate + Gender uint16 + HomePageAddr string `oscar:"len_prefix=uint16,nullterm"` + BirthYear uint16 + BirthMonth uint8 + BirthDay uint8 + Lang1 uint8 + Lang2 uint8 + Lang3 uint8 +} - FeedbagRightsMaxClassAttrs uint16 = 0x02 - FeedbagRightsMaxItemAttrs uint16 = 0x03 - FeedbagRightsMaxItemsByClass uint16 = 0x04 - FeedbagRightsMaxClientItems uint16 = 0x05 - FeedbagRightsMaxItemNameLen uint16 = 0x06 - FeedbagRightsMaxRecentBuddies uint16 = 0x07 - FeedbagRightsInteractionBuddies uint16 = 0x08 - FeedbagRightsInteractionHalfLife uint16 = 0x09 - FeedbagRightsInteractionMaxScore uint16 = 0x0A - FeedbagRightsMaxUnknown0b uint16 = 0x0B - FeedbagRightsMaxBuddiesPerGroup uint16 = 0x0C - FeedbagRightsMaxMegaBots uint16 = 0x0D - FeedbagRightsMaxSmartGroups uint16 = 0x0E +type ICQ_0x07D0_0x03F3_DBQueryMetaReqSetWorkInfo struct { + City string `oscar:"len_prefix=uint16,nullterm"` + State string `oscar:"len_prefix=uint16,nullterm"` + Phone string `oscar:"len_prefix=uint16,nullterm"` + Fax string `oscar:"len_prefix=uint16,nullterm"` + Address string `oscar:"len_prefix=uint16,nullterm"` + ZIP string `oscar:"len_prefix=uint16,nullterm"` + CountryCode uint16 + Company string `oscar:"len_prefix=uint16,nullterm"` + Department string `oscar:"len_prefix=uint16,nullterm"` + Position string `oscar:"len_prefix=uint16,nullterm"` + OccupationCode uint16 + WebPage string `oscar:"len_prefix=uint16,nullterm"` +} - FeedbagErr uint16 = 0x0001 - FeedbagRightsQuery uint16 = 0x0002 - FeedbagRightsReply uint16 = 0x0003 - FeedbagQuery uint16 = 0x0004 - FeedbagQueryIfModified uint16 = 0x0005 - FeedbagReply uint16 = 0x0006 - FeedbagUse uint16 = 0x0007 - FeedbagInsertItem uint16 = 0x0008 - FeedbagUpdateItem uint16 = 0x0009 - FeedbagDeleteItem uint16 = 0x000A - FeedbagInsertClass uint16 = 0x000B - FeedbagUpdateClass uint16 = 0x000C - FeedbagDeleteClass uint16 = 0x000D - FeedbagStatus uint16 = 0x000E - FeedbagReplyNotModified uint16 = 0x000F - FeedbagDeleteUser uint16 = 0x0010 - FeedbagStartCluster uint16 = 0x0011 - FeedbagEndCluster uint16 = 0x0012 - FeedbagAuthorizeBuddy uint16 = 0x0013 - FeedbagPreAuthorizeBuddy uint16 = 0x0014 - FeedbagPreAuthorizedBuddy uint16 = 0x0015 - FeedbagRemoveMe uint16 = 0x0016 - FeedbagRemoveMe2 uint16 = 0x0017 - FeedbagRequestAuthorizeToHost uint16 = 0x0018 - FeedbagRequestAuthorizeToClient uint16 = 0x0019 - FeedbagRespondAuthorizeToHost uint16 = 0x001A - FeedbagRespondAuthorizeToClient uint16 = 0x001B - FeedbagBuddyAdded uint16 = 0x001C - FeedbagRequestAuthorizeToBadog uint16 = 0x001D - FeedbagRespondAuthorizeToBadog uint16 = 0x001E - FeedbagBuddyAddedToBadog uint16 = 0x001F - FeedbagTestSnac uint16 = 0x0021 - FeedbagForwardMsg uint16 = 0x0022 - FeedbagIsAuthRequiredQuery uint16 = 0x0023 - FeedbagIsAuthRequiredReply uint16 = 0x0024 - FeedbagRecentBuddyUpdate uint16 = 0x0025 -) +type ICQ_0x07D0_0x040B_DBQueryMetaReqSetEmails struct { + Emails []struct { + Publish uint8 + Email string `oscar:"len_prefix=uint16,nullterm"` + } `oscar:"count_prefix=uint8"` +} -type SNAC_0x13_0x02_FeedbagRightsQuery struct { - TLVRestBlock +type ICQ_0x07D0_0x0406_DBQueryMetaReqSetNotes struct { + Notes string `oscar:"len_prefix=uint16,nullterm"` } -type SNAC_0x13_0x03_FeedbagRightsReply struct { +type ICQ_0x07D0_0x0410_DBQueryMetaReqSetInterests struct { + Interests []struct { + Code uint16 + Keyword string `oscar:"len_prefix=uint16,nullterm"` + } `oscar:"count_prefix=uint8"` +} + +type ICQ_0x07D0_0x041A_DBQueryMetaReqSetAffiliations struct { + PastAffiliations []struct { + Code uint16 + Keyword string `oscar:"len_prefix=uint16,nullterm"` + } `oscar:"count_prefix=uint8"` + Affiliations []struct { + Code uint16 + Keyword string `oscar:"len_prefix=uint16,nullterm"` + } `oscar:"count_prefix=uint8"` +} + +type ICQ_0x07D0_0x03EA_DBQueryMetaReqSetBasicInfo struct { + Nickname string `oscar:"len_prefix=uint16,nullterm"` + FirstName string `oscar:"len_prefix=uint16,nullterm"` + LastName string `oscar:"len_prefix=uint16,nullterm"` + EmailAddress string `oscar:"len_prefix=uint16,nullterm"` + City string `oscar:"len_prefix=uint16,nullterm"` + State string `oscar:"len_prefix=uint16,nullterm"` + Phone string `oscar:"len_prefix=uint16,nullterm"` + Fax string `oscar:"len_prefix=uint16,nullterm"` + HomeAddress string `oscar:"len_prefix=uint16,nullterm"` + CellPhone string `oscar:"len_prefix=uint16,nullterm"` + ZIP string `oscar:"len_prefix=uint16,nullterm"` + CountryCode uint16 + GMTOffset uint8 + PublishEmail uint8 +} + +type SNAC_0x15_0x02_DBReply struct { TLVRestBlock } -type SNAC_0x13_0x05_FeedbagQueryIfModified struct { - LastUpdate uint32 - Count uint8 +type ICQ_0x07DA_0x010E_DBQueryMetaReplyHomePageCat struct { + ICQMetadata + ReqSubType uint16 + Success uint8 + Enabled uint8 + CatCode uint16 + Keywords string `oscar:"len_prefix=uint16,nullterm"` + Unknown uint8 } -type SNAC_0x13_0x06_FeedbagReply struct { - Version uint8 - Items []FeedbagItem `oscar:"count_prefix=uint16"` - LastUpdate uint32 +type ICQ_0x07DA_0x08A2_DBQueryMetaReplyXMLData struct { + ICQMetadata + ReqSubType uint16 + Success uint8 + XML string `oscar:"len_prefix=uint16,nullterm"` } -type SNAC_0x13_0x08_FeedbagInsertItem struct { - Items []FeedbagItem +type ICQ_0x07DA_0x00DC_DBQueryMetaReplyMoreInfo struct { + ICQMetadata + ReqSubType uint16 + Success uint8 + ICQ_0x07D0_0x03FD_DBQueryMetaReqSetMoreInfo + Unknown uint16 + City string `oscar:"len_prefix=uint16,nullterm"` + State string `oscar:"len_prefix=uint16,nullterm"` + CountryCode uint16 + TimeZone uint8 } -type SNAC_0x13_0x09_FeedbagUpdateItem struct { - Items []FeedbagItem +type ICQ_0x07DA_0x00EB_DBQueryMetaReplyExtEmailInfo struct { + ICQMetadata + ReqSubType uint16 + Success uint8 + Emails []struct { + Flag uint8 // (0-publish, 1-don't) + Email string `oscar:"len_prefix=uint16,nullterm"` + } `oscar:"count_prefix=uint8"` } -type SNAC_0x13_0x0A_FeedbagDeleteItem struct { - Items []FeedbagItem +type ICQ_0x07DA_0x00D2_DBQueryMetaReplyWorkInfo struct { + ICQMetadata + ReqSubType uint16 + Success uint8 + ICQ_0x07D0_0x03F3_DBQueryMetaReqSetWorkInfo } -type SNAC_0x13_0x0E_FeedbagStatus struct { - Results []uint16 +type ICQ_0x07DA_0x00F0_DBQueryMetaReplyInterests struct { + ICQMetadata + ReqSubType uint16 + Success uint8 + Interests []struct { + Code uint16 + Keyword string `oscar:"len_prefix=uint16,nullterm"` + } `oscar:"count_prefix=uint8"` } -type SNAC_0x13_0x11_FeedbagStartCluster struct { - TLVRestBlock +type ICQ_0x07DA_0x00E6_DBQueryMetaReplyNotes struct { + ICQMetadata + ReqSubType uint16 + Success uint8 + ICQ_0x07D0_0x0406_DBQueryMetaReqSetNotes +} + +type ICQ_0x07DA_0x00FA_DBQueryMetaReplyAffiliations struct { + ICQMetadata + ReqSubType uint16 + Success uint8 + ICQ_0x07D0_0x041A_DBQueryMetaReqSetAffiliations +} + +type ICQ_0x07DA_0x00C8_DBQueryMetaReplyBasicInfo struct { + ICQMetadata + ReqSubType uint16 + Success uint8 + Nickname string `oscar:"len_prefix=uint16,nullterm"` + FirstName string `oscar:"len_prefix=uint16,nullterm"` + LastName string `oscar:"len_prefix=uint16,nullterm"` + Email string `oscar:"len_prefix=uint16,nullterm"` + City string `oscar:"len_prefix=uint16,nullterm"` + State string `oscar:"len_prefix=uint16,nullterm"` + Phone string `oscar:"len_prefix=uint16,nullterm"` + Fax string `oscar:"len_prefix=uint16,nullterm"` + Address string `oscar:"len_prefix=uint16,nullterm"` + CellPhone string `oscar:"len_prefix=uint16,nullterm"` + ZIP string `oscar:"len_prefix=uint16,nullterm"` + CountryCode uint16 + GMTOffset uint8 + AuthFlag uint8 + WebAware uint8 + DCPerms uint8 + PublishEmail uint8 +} + +type ICQ_0x07DA_0x01AE_DBQueryMetaReplyLastUserFound struct { + ICQMetadata + ReqSubType uint16 + Success uint8 + Details ICQUserSearchRecord `oscar:"len_prefix=uint16"` + // LastMessageFooter is set only on the last message in the batch + LastMessageFooter *struct { + FoundUsersLeft uint32 + } `oscar:"optional"` +} + +// LastResult flags the message as the last message in the search results. +func (s *ICQ_0x07DA_0x01AE_DBQueryMetaReplyLastUserFound) LastResult() { + s.ReqSubType = ICQDBQueryMetaReplyLastUserFound + s.LastMessageFooter = &struct { + FoundUsersLeft uint32 + }{ + FoundUsersLeft: 0, + } +} + +type ICQ_0x07DA_0x0104_DBQueryMetaReplyShortInfo struct { + ICQMetadata + ReqSubType uint16 + Success uint8 + Nickname string `oscar:"len_prefix=uint16,nullterm"` + FirstName string `oscar:"len_prefix=uint16,nullterm"` + LastName string `oscar:"len_prefix=uint16,nullterm"` + Email string `oscar:"len_prefix=uint16,nullterm"` + Authorization uint8 + Unknown uint8 + Gender uint8 +} + +type ICQ_0x0041_DBQueryOfflineMsgReply struct { + ICQMetadata + SenderUIN uint32 + Year uint16 + Month uint8 + Day uint8 + Hour uint8 + Minute uint8 + MsgType uint8 + Flags uint8 + Message string `oscar:"len_prefix=uint16,nullterm"` +} + +type ICQ_0x0042_DBQueryOfflineMsgReplyLast struct { + ICQMetadata + DroppedMessages uint8 +} + +type ICQMetadataWithSubType struct { + ICQMetadata + Optional *struct { + ReqSubType uint16 + } `oscar:"optional"` +} + +type ICQMetadata struct { + UIN uint32 + ReqType uint16 + Seq uint16 +} + +// ICQMessageRequestEnvelope is a helper struct that provides syntactic sugar for +// unmarshaling an ICQ message into a little-endian byte array. +type ICQMessageRequestEnvelope struct { + Body []byte `oscar:"len_prefix=uint16"` +} + +// ICQMessageReplyEnvelope is a helper struct that provides syntactic sugar for +// marshaling an ICQ message into a little-endian byte array. +type ICQMessageReplyEnvelope struct { + Message any `oscar:"len_prefix=uint16"` +} + +type ICQUserSearchRecord struct { + UIN uint32 + Nickname string `oscar:"len_prefix=uint16,nullterm"` + FirstName string `oscar:"len_prefix=uint16,nullterm"` + LastName string `oscar:"len_prefix=uint16,nullterm"` + Email string `oscar:"len_prefix=uint16,nullterm"` + Authorization uint8 + OnlineStatus uint16 + Gender uint8 + Age uint16 } //