snacs.go 100 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797
  1. package wire
  2. import (
  3. "bytes"
  4. "errors"
  5. "fmt"
  6. "strconv"
  7. "strings"
  8. "github.com/google/uuid"
  9. )
  10. //
  11. // Food Group Codes
  12. //
  13. const (
  14. BOS uint16 = 0x0000
  15. OService uint16 = 0x0001
  16. Locate uint16 = 0x0002
  17. Buddy uint16 = 0x0003
  18. ICBM uint16 = 0x0004
  19. Advert uint16 = 0x0005
  20. Invite uint16 = 0x0006
  21. Admin uint16 = 0x0007
  22. Popup uint16 = 0x0008
  23. PermitDeny uint16 = 0x0009
  24. UserLookup uint16 = 0x000A
  25. Stats uint16 = 0x000B
  26. Translate uint16 = 0x000C
  27. ChatNav uint16 = 0x000D
  28. Chat uint16 = 0x000E
  29. ODir uint16 = 0x000F
  30. BART uint16 = 0x0010
  31. Feedbag uint16 = 0x0013
  32. ICQ uint16 = 0x0015
  33. BUCP uint16 = 0x0017
  34. Alert uint16 = 0x0018
  35. Plugin uint16 = 0x0022
  36. UnnamedFG24 uint16 = 0x0024
  37. MDir uint16 = 0x0025
  38. ARS uint16 = 0x044A
  39. Kerberos uint16 = 0x050C
  40. )
  41. //
  42. // General Error Codes
  43. //
  44. const (
  45. ErrorCodeInvalidSnac uint16 = 0x01
  46. ErrorCodeRateToHost uint16 = 0x02
  47. ErrorCodeRateToClient uint16 = 0x03
  48. ErrorCodeNotLoggedOn uint16 = 0x04
  49. ErrorCodeServiceUnavailable uint16 = 0x05
  50. ErrorCodeServiceNotDefined uint16 = 0x06
  51. ErrorCodeObsoleteSnac uint16 = 0x07
  52. ErrorCodeNotSupportedByHost uint16 = 0x08
  53. ErrorCodeNotSupportedByClient uint16 = 0x09
  54. ErrorCodeRefusedByClient uint16 = 0x0A
  55. ErrorCodeReplyTooBig uint16 = 0x0B
  56. ErrorCodeResponsesLost uint16 = 0x0C
  57. ErrorCodeRequestDenied uint16 = 0x0D
  58. ErrorCodeBustedSnacPayload uint16 = 0x0E
  59. ErrorCodeInsufficientRights uint16 = 0x0F
  60. ErrorCodeInLocalPermitDeny uint16 = 0x10
  61. ErrorCodeTooEvilSender uint16 = 0x11
  62. ErrorCodeTooEvilReceiver uint16 = 0x12
  63. ErrorCodeUserTempUnavail uint16 = 0x13
  64. ErrorCodeNoMatch uint16 = 0x14
  65. ErrorCodeListOverflow uint16 = 0x15
  66. ErrorCodeRequestAmbigous uint16 = 0x16
  67. ErrorCodeQueueFull uint16 = 0x17
  68. ErrorCodeNotWhileOnAol uint16 = 0x18
  69. ErrorCodeQueryFail uint16 = 0x19
  70. ErrorCodeTimeout uint16 = 0x1A
  71. ErrorCodeErrorText uint16 = 0x1B
  72. ErrorCodeGeneralFailure uint16 = 0x1C
  73. ErrorCodeProgress uint16 = 0x1D
  74. ErrorCodeInFreeArea uint16 = 0x1E
  75. ErrorCodeRestrictedByPc uint16 = 0x1F
  76. ErrorCodeRemoteRestrictedByPc uint16 = 0x20
  77. ErrorTLVFailURL uint16 = 0x0004 // URL with more detail
  78. ErrorTLVErrorSubcode uint16 = 0x0008 // Foodgroup-specific error code
  79. ErrorTLVErrorText uint16 = 0x001B // String error message text
  80. ErrorTLVErrorInfoCLSID uint16 = 0x0029 // UUID specifying format of ERROR_INFO_DATA data
  81. ErrorTLVErrorInfoData uint16 = 0x002A // Extra information describing error
  82. )
  83. //
  84. // Authentication
  85. //
  86. const (
  87. LoginTLVTagsScreenName uint16 = 0x01
  88. LoginTLVTagsRoastedPassword uint16 = 0x02
  89. LoginTLVTagsClientIdentity uint16 = 0x03
  90. LoginTLVTagsReconnectHere uint16 = 0x05
  91. LoginTLVTagsAuthorizationCookie uint16 = 0x06
  92. LoginTLVTagsErrorSubcode uint16 = 0x08
  93. LoginTLVTagsPasswordHash uint16 = 0x25
  94. LoginTLVTagsMultiConnFlags uint16 = 0x4A
  95. LoginTLVTagsMaxSendSize uint16 = 0x8001
  96. LoginTLVTagsMaxRecvSize uint16 = 0x8003
  97. LoginTLVTagsHostSuffix uint16 = 0x8004
  98. LoginTLVTagsRoastedKerberosPassword uint16 = 0x1335
  99. LoginTLVTagsRoastedTOCPassword uint16 = 0x1337
  100. LoginTLVTagsPlaintextPassword uint16 = 0x1338
  101. LoginTLVTagsUseBigTime uint16 = 0x2038
  102. )
  103. const (
  104. LoginErrInvalidUsernameOrPassword uint16 = 0x0001
  105. LoginErrInvalidPassword uint16 = 0x0005 // invalid password
  106. LoginErrInvalidAccount uint16 = 0x0007
  107. LoginErrDeletedAccount uint16 = 0x0008
  108. LoginErrExpiredAccount uint16 = 0x0009
  109. LoginErrSuspendedAccount uint16 = 0x0011 // suspended account
  110. LoginErrTooHeavilyWarned uint16 = 0x0019
  111. LoginErrRateLimitExceeded uint16 = 0x001D
  112. LoginErrInvalidSecureID uint16 = 0x0020
  113. LoginErrSuspendedAccountAge uint16 = 0x0022 // suspended due to age (age < 13 years)
  114. LoginErrICQUserErr uint16 = 0x0008 // ICQ user doesn't exist
  115. )
  116. type MultiConnFlag uint8
  117. const (
  118. MultiConnFlagsOldClient MultiConnFlag = 0x0 // client doesn't support multi-conn
  119. MultiConnFlagsRecentClient MultiConnFlag = 0x1 // client supports multi-conn
  120. MultiConnFlagsSingleClient MultiConnFlag = 0x3 // client supports multi-conn but only wants 1 concurrent session
  121. )
  122. //
  123. // Capability IDs
  124. //
  125. var (
  126. // CapChat is the UUID that represents an OSCAR client's ability to chat
  127. CapChat = uuid.MustParse("748F2420-6287-11D1-8222-444553540000")
  128. // CapFileTransfer is the UUID that represents an OSCAR client's ability to send files
  129. CapFileTransfer = uuid.MustParse("09461343-4C7F-11D1-8222-444553540000")
  130. //
  131. // Short Caps (0946XXYY-4C7F-11D1-8222-444553540000 format)
  132. //
  133. // CapShortCaps indicates the client supports short capability format
  134. CapShortCaps = uuid.MustParse("09460000-4C7F-11D1-8222-444553540000")
  135. // CapSecureIM indicates the client supports SECURE_IM encryption
  136. CapSecureIM = uuid.MustParse("09460001-4C7F-11D1-8222-444553540000")
  137. // CapXHTMLIM indicates the client supports XHTML profile and IMs instead of AOLRTF
  138. CapXHTMLIM = uuid.MustParse("09460002-4C7F-11D1-8222-444553540000")
  139. // CapRTCVideo indicates the client supports SIP/RTP video
  140. CapRTCVideo = uuid.MustParse("09460101-4C7F-11D1-8222-444553540000")
  141. // CapHasCamera indicates the client has a camera
  142. CapHasCamera = uuid.MustParse("09460102-4C7F-11D1-8222-444553540000")
  143. // CapHasMicrophone indicates the client has a microphone
  144. CapHasMicrophone = uuid.MustParse("09460103-4C7F-11D1-8222-444553540000")
  145. // CapRTCAudio indicates the client supports RTC audio
  146. CapRTCAudio = uuid.MustParse("09460104-4C7F-11D1-8222-444553540000")
  147. // CapHostStatusTextAware indicates the client supports new status message features
  148. CapHostStatusTextAware = uuid.MustParse("0946010A-4C7F-11D1-8222-444553540000")
  149. // CapRTIM indicates the client supports "see as I type" IMs
  150. CapRTIM = uuid.MustParse("0946010B-4C7F-11D1-8222-444553540000")
  151. // CapSmartCaps indicates the client only asserts caps for services it is participating in
  152. CapSmartCaps = uuid.MustParse("094601FF-4C7F-11D1-8222-444553540000")
  153. // CapVoiceChat indicates the client supports voice chat (AIM)
  154. CapVoiceChat = uuid.MustParse("09461341-4C7F-11D1-8222-444553540000")
  155. // CapDirectPlay indicates the client supports direct play service (AIM)
  156. CapDirectPlay = uuid.MustParse("09461342-4C7F-11D1-8222-444553540000")
  157. // CapRouteFinder indicates the client supports route finder (ICQ)
  158. CapRouteFinder = uuid.MustParse("09461344-4C7F-11D1-8222-444553540000")
  159. // CapDirectICBM indicates the client supports P2P IMs
  160. CapDirectICBM = uuid.MustParse("09461345-4C7F-11D1-8222-444553540000")
  161. // CapAvatarService indicates the client supports avatar service (AIM)
  162. CapAvatarService = uuid.MustParse("09461346-4C7F-11D1-8222-444553540000")
  163. // CapStocksAddins indicates the client supports stocks/add-ins (AIM)
  164. CapStocksAddins = uuid.MustParse("09461347-4C7F-11D1-8222-444553540000")
  165. // CapFileSharing indicates the client supports file sharing
  166. CapFileSharing = uuid.MustParse("09461348-4C7F-11D1-8222-444553540000")
  167. // CapICQCh2Extended indicates the client supports channel 2 extended TLV(0x2711) messages (ICQ)
  168. CapICQCh2Extended = uuid.MustParse("09461349-4C7F-11D1-8222-444553540000")
  169. // CapGames indicates the client supports games (AIM)
  170. CapGames = uuid.MustParse("0946134A-4C7F-11D1-8222-444553540000")
  171. // CapBuddyListTransfer indicates the client supports buddy lists transfer (AIM)
  172. CapBuddyListTransfer = uuid.MustParse("0946134B-4C7F-11D1-8222-444553540000")
  173. // CapSupportICQ indicates the client supports talking to ICQ users
  174. CapSupportICQ = uuid.MustParse("0946134D-4C7F-11D1-8222-444553540000")
  175. // CapUTF8Messages indicates the client supports UTF-8 messages (AIM)
  176. CapUTF8Messages = uuid.MustParse("0946134E-4C7F-11D1-8222-444553540000")
  177. //
  178. // Full UUIDs (non-short format)
  179. //
  180. // CapRTFMessages indicates the client supports RTF messages (ICQ)
  181. CapRTFMessages = uuid.MustParse("97B12751-243C-4334-AD22-D6ABF73F1492")
  182. // CapTrillianSecureIM indicates the client supports Trillian SecureIM messages
  183. CapTrillianSecureIM = uuid.MustParse("F2E7C7F4-FEAD-4DFB-B235-36798BDF0000")
  184. // CapXtrazScript is the UUID for the ICQ Xtraz/Tzer.
  185. // Xtraz enables extended status (XStatus), greeting cards, and chat invitations.
  186. CapXtrazScript = uuid.MustParse("3B60B3EF-D82A-6C45-A4E0-9C5A5E67E865")
  187. //
  188. // Unknown/Legacy UUIDs
  189. //
  190. // CapUnknownICQ2001_2002 is an unknown capability seen in ICQ 2001/2002
  191. CapUnknownICQ2001_2002 = uuid.MustParse("A0E93F37-4C7F-11D1-8222-444553540000")
  192. // CapUnknownICQ2002 is an unknown capability seen in ICQ 2002
  193. CapUnknownICQ2002 = uuid.MustParse("10CF40D1-4C7F-11D1-8222-444553540000")
  194. // CapUnknownICQ2001 is an unknown capability seen in ICQ 2001
  195. CapUnknownICQ2001 = uuid.MustParse("2E7A6475-FADF-4DC8-886F-EA3595FDB6DF")
  196. // CapUnknownICQLite is an unknown capability seen in ICQLite/ICQ2Go
  197. CapUnknownICQLite = uuid.MustParse("563FC809-0B6F-41BD-9F79-422609DFA2F3")
  198. // CapGamesAlt is an alternate games capability with different endianness (AIM)
  199. CapGamesAlt = uuid.MustParse("0946134A-4C7F-11D1-2282-444553540000")
  200. )
  201. // ShortCapHexToUUID converts an OSCAR short capability code (1–4 hex digits, e.g. "1348", "1FF")
  202. // to the full UUID form 0946XXYY-4C7F-11D1-8222-444553540000. Returns the UUID and true if the
  203. // input is valid hex that fits in a uint16; otherwise returns zero UUID and false.
  204. func ShortCapHexToUUID(hexStr string) (uuid.UUID, bool) {
  205. hexStr = strings.TrimSpace(hexStr)
  206. if hexStr == "" || len(hexStr) > 4 {
  207. return uuid.Nil, false
  208. }
  209. val, err := strconv.ParseUint(hexStr, 16, 16)
  210. if err != nil {
  211. return uuid.Nil, false
  212. }
  213. // Format: 0946XXYY-4C7F-11D1-8222-444553540000 (XXYY = 16-bit short cap in big-endian hex)
  214. uuidStr := fmt.Sprintf("0946%04X-4C7F-11D1-8222-444553540000", val)
  215. uid, err := uuid.Parse(uuidStr)
  216. if err != nil {
  217. return uuid.Nil, false
  218. }
  219. return uid, true
  220. }
  221. //
  222. // 0x01: OService
  223. //
  224. const (
  225. OServiceErr uint16 = 0x0001
  226. OServiceClientOnline uint16 = 0x0002
  227. OServiceHostOnline uint16 = 0x0003
  228. OServiceServiceRequest uint16 = 0x0004
  229. OServiceServiceResponse uint16 = 0x0005
  230. OServiceRateParamsQuery uint16 = 0x0006
  231. OServiceRateParamsReply uint16 = 0x0007
  232. OServiceRateParamsSubAdd uint16 = 0x0008
  233. OServiceRateDelParamSub uint16 = 0x0009
  234. OServiceRateParamChange uint16 = 0x000A
  235. OServicePauseReq uint16 = 0x000B
  236. OServicePauseAck uint16 = 0x000C
  237. OServiceResume uint16 = 0x000D
  238. OServiceUserInfoQuery uint16 = 0x000E
  239. OServiceUserInfoUpdate uint16 = 0x000F
  240. OServiceEvilNotification uint16 = 0x0010
  241. OServiceIdleNotification uint16 = 0x0011
  242. OServiceMigrateGroups uint16 = 0x0012
  243. OServiceMotd uint16 = 0x0013
  244. OServiceSetPrivacyFlags uint16 = 0x0014
  245. OServiceWellKnownUrls uint16 = 0x0015
  246. OServiceNoop uint16 = 0x0016
  247. OServiceClientVersions uint16 = 0x0017
  248. OServiceHostVersions uint16 = 0x0018
  249. OServiceMaxConfigQuery uint16 = 0x0019
  250. OServiceMaxConfigReply uint16 = 0x001A
  251. OServiceStoreConfig uint16 = 0x001B
  252. OServiceConfigQuery uint16 = 0x001C
  253. OServiceConfigReply uint16 = 0x001D
  254. OServiceSetUserInfoFields uint16 = 0x001E
  255. OServiceProbeReq uint16 = 0x001F
  256. OServiceProbeAck uint16 = 0x0020
  257. OServiceBartReply uint16 = 0x0021
  258. OServiceBartQuery2 uint16 = 0x0022
  259. OServiceBartReply2 uint16 = 0x0023
  260. OServiceUserInfoUserFlags uint16 = 0x01
  261. OServiceUserInfoSignonTOD uint16 = 0x03
  262. OServiceUserInfoIdleTime uint16 = 0x04
  263. OServiceUserInfoMemberSince uint16 = 0x05
  264. OServiceUserInfoStatus uint16 = 0x06
  265. OServiceUserInfoICQDC uint16 = 0x0C
  266. OServiceUserInfoOscarCaps uint16 = 0x0D
  267. OServiceUserInfoOnlineTime uint16 = 0x0F
  268. OServiceUserInfoBARTInfo uint16 = 0x1D
  269. OServiceUserInfoMySubscriptions uint16 = 0x1E
  270. OServiceUserInfoUserFlags2 uint16 = 0x1F
  271. OServiceUserInfoMyInstanceNum uint16 = 0x14
  272. OServiceUserInfoSigTime uint16 = 0x26
  273. OServiceUserInfoPrimaryInstance uint16 = 0x28
  274. OServiceUserStatusAvailable uint32 = 0x00000000 // user is available
  275. OServiceUserStatusAway uint32 = 0x00000001 // user is away
  276. OServiceUserStatusDND uint32 = 0x00000002 // don't disturb user
  277. OServiceUserStatusOut uint32 = 0x00000004 // user is not available
  278. OServiceUserStatusBusy uint32 = 0x00000010 // user is busy
  279. OServiceUserStatusChat uint32 = 0x00000020 // user is available to chat
  280. OServiceUserStatusInvisible uint32 = 0x00000100 // user is invisible
  281. OServiceUserStatusWebAware uint32 = 0x00010000
  282. OServiceUserStatusHideIP uint32 = 0x00020000
  283. OServiceUserStatusBirthday uint32 = 0x00080000 // user is having a birthday :DDD
  284. OServiceUserStatusICQHomePage uint32 = 0x00200000
  285. OServiceUserStatusDirectRequireAuth uint32 = 0x10000000
  286. OServiceUserFlagUnconfirmed uint16 = 0x0001 // Unconfirmed account
  287. OServiceUserFlagAdministrator uint16 = 0x0002 // Server Administrator
  288. OServiceUserFlagAOL uint16 = 0x0004 // AOL (staff?) account
  289. OServiceUserFlagOSCARPay uint16 = 0x0008 // Commercial account
  290. OServiceUserFlagOSCARFree uint16 = 0x0010 // AIM (not AOL) account
  291. OServiceUserFlagUnavailable uint16 = 0x0020 // user is away
  292. OServiceUserFlagICQ uint16 = 0x0040 // ICQ user (OServiceUserFlagOSCARFree should also be set)
  293. OServiceUserFlagWireless uint16 = 0x0080 // On mobile device
  294. OServiceUserFlagInternal uint16 = 0x0100 // Internal account
  295. OServiceUserFlagFish uint16 = 0x0200 // IM forwarding enabled
  296. OServiceUserFlagBot uint16 = 0x0400 // Bot account
  297. OServiceUserFlagBeast uint16 = 0x0800 // Unknown
  298. OServiceUserFlagOneWayWireless uint16 = 0x1000 // On one way mobile device
  299. OServiceUserFlagOfficial uint16 = 0x2000 // Unknown
  300. OServiceUserFlag2BuddyMatchDirect uint32 = 0x00010000 // Unknown
  301. OServiceUserFlag2BuddyMatchIndirect uint32 = 0x00020000 // Unknown
  302. OServiceUserFlag2NoKnockKnock uint32 = 0x00040000 // Sender is safe
  303. OServiceUserFlag2ForwardMobile uint32 = 0x00080000 // Forward to mobile if no acive session
  304. OServicePrivacyFlagIdle uint32 = 0x00000001
  305. OServicePrivacyFlagMember uint32 = 0x00000002
  306. OServiceTLVTagsReconnectHere uint16 = 0x05
  307. OServiceTLVTagsLoginCookie uint16 = 0x06
  308. OServiceTLVTagsGroupID uint16 = 0x0D
  309. OServiceTLVTagsSSLCertName uint16 = 0x8D
  310. OServiceTLVTagsSSLState uint16 = 0x8E
  311. OserviceTLVTagsSSLUseSSL uint16 = 0x8C
  312. OServiceTLVTagsMOTDMessage uint16 = 0x0B
  313. OServiceDiscErrNewLogin uint8 = 0x01
  314. OServiceDiscErrAccDeleted uint8 = 0x02
  315. OServiceServiceResponseSSLStateNotUsed uint8 = 0x00 // SSL is not supported or not requested for this connection
  316. OServiceServiceResponseSSLStateUse uint8 = 0x01 // SSL is being used
  317. OServiceServiceResponseSSLStateResume uint8 = 0x02 // SSL is being used and SSL resume is supported if desired
  318. )
  319. type SNAC_0x01_0x02_OServiceClientOnline struct {
  320. GroupVersions []struct {
  321. FoodGroup uint16
  322. Version uint16
  323. ToolID uint16
  324. ToolVersion uint16
  325. }
  326. }
  327. type SNAC_0x01_0x03_OServiceHostOnline struct {
  328. FoodGroups []uint16
  329. }
  330. type SNAC_0x01_0x04_OServiceServiceRequest struct {
  331. FoodGroup uint16
  332. TLVRestBlock
  333. }
  334. type SNAC_0x01_0x04_TLVRoomInfo struct {
  335. Exchange uint16
  336. Cookie string `oscar:"len_prefix=uint8"`
  337. InstanceNumber uint16
  338. }
  339. type SNAC_0x01_0x05_OServiceServiceResponse struct {
  340. TLVRestBlock
  341. }
  342. type RateParamsSNAC struct {
  343. ID uint16
  344. WindowSize uint32
  345. ClearLevel uint32
  346. AlertLevel uint32
  347. LimitLevel uint32
  348. DisconnectLevel uint32
  349. CurrentLevel uint32
  350. MaxLevel uint32
  351. V2Params *struct {
  352. LastTime uint32
  353. DroppingSNACs uint8
  354. } `oscar:"optional"`
  355. }
  356. // SNAC_0x01_0x07_OServiceRateParamsReply contains rate limits for rate classes and groups.
  357. //
  358. // Rate Classes:
  359. // - ID: Unique identifier for the rate class.
  360. // - WindowSize: The number of previously sent commands included in calculating
  361. // the current "rate average."
  362. // - ClearLevel: The threshold the average must reach to clear a rate limit.
  363. // - AlertLevel: The threshold for triggering an alert that tells the client
  364. // that it's getting close to the limit.
  365. // - LimitLevel: SNACs will be dropped if the rate falls below this value.
  366. // - DisconnectLevel: Server will disconnect if the rate falls below this value.
  367. // - CurrentLevel: The current value for the class; higher values are preferable.
  368. // Represents the current "rate average," resembling a moving average of the
  369. // times between each of the last WindowSize commands.
  370. // - MaxLevel: The maximum rate value; if the current value surpasses this,
  371. // it should be reset. The upper limit for a rate average.
  372. // - LastTime: Time elapsed since the last message was received by the server.
  373. // - CurrentStatus: Indicates whether the server is dropping SNACs for this rate class.
  374. //
  375. // Rate Groups:
  376. // - ID: Unique identifier for the rate group.
  377. // - Pairs: List of SNAC types associated with the rate group, including FoodGroup
  378. // (e.g., wire.ICBM) and SubGroup (e.g., wire.ICBMChannelMsgToHost).
  379. type SNAC_0x01_0x07_OServiceRateParamsReply struct {
  380. RateClasses []RateParamsSNAC `oscar:"count_prefix=uint16"`
  381. RateGroups []struct {
  382. ID uint16
  383. Pairs []struct {
  384. FoodGroup uint16
  385. SubGroup uint16
  386. } `oscar:"count_prefix=uint16"`
  387. }
  388. }
  389. type SNAC_0x01_0x0A_OServiceRateParamsChange struct {
  390. Code uint16
  391. Rate RateParamsSNAC
  392. }
  393. type SNAC_0x01_0x08_OServiceRateParamsSubAdd struct {
  394. ClassIDs []uint16
  395. }
  396. type SNAC_0x01_0x0F_OServiceUserInfoUpdate struct {
  397. UserInfo []TLVUserInfo
  398. }
  399. type SNAC_0x01_0x10_OServiceEvilNotification struct {
  400. NewEvil uint16
  401. // Snitcher specifies the user who sent the warning. Nil pointer indicates
  402. // an anonymous warning.
  403. Snitcher *struct {
  404. TLVUserInfo
  405. } `oscar:"optional"`
  406. }
  407. type SNAC_0x01_0x11_OServiceIdleNotification struct {
  408. IdleTime uint32
  409. }
  410. type SNAC_0x01_0x13_OServiceMOTD struct {
  411. MessageType uint16
  412. TLVRestBlock
  413. }
  414. type SNAC_0x01_0x14_OServiceSetPrivacyFlags struct {
  415. PrivacyFlags uint32
  416. }
  417. // IdleFlag returns whether other AIM users can see how long the user has been
  418. // idle.
  419. func (s SNAC_0x01_0x14_OServiceSetPrivacyFlags) IdleFlag() bool {
  420. return s.PrivacyFlags&OServicePrivacyFlagIdle == OServicePrivacyFlagIdle
  421. }
  422. // MemberFlag returns whether other AIM users can see how long the user has been
  423. // a member.
  424. func (s SNAC_0x01_0x14_OServiceSetPrivacyFlags) MemberFlag() bool {
  425. return s.PrivacyFlags&OServicePrivacyFlagMember == OServicePrivacyFlagMember
  426. }
  427. type SNAC_0x01_0x17_OServiceClientVersions struct {
  428. Versions []uint16
  429. }
  430. type SNAC_0x01_0x18_OServiceHostVersions struct {
  431. Versions []uint16
  432. }
  433. type SNAC_0x01_0x1E_OServiceSetUserInfoFields struct {
  434. TLVRestBlock
  435. }
  436. type SNAC_0x01_0x21_OServiceBARTReply struct {
  437. BARTID
  438. }
  439. type SNAC_0x01_0x23_OServiceBART2Reply struct {
  440. ReplyID []BartQueryReplyID
  441. }
  442. //
  443. // 0x02: Locate
  444. //
  445. const (
  446. LocateErr uint16 = 0x0001
  447. LocateRightsQuery uint16 = 0x0002
  448. LocateRightsReply uint16 = 0x0003
  449. LocateSetInfo uint16 = 0x0004
  450. LocateUserInfoQuery uint16 = 0x0005
  451. LocateUserInfoReply uint16 = 0x0006
  452. LocateWatcherSubRequest uint16 = 0x0007
  453. LocateWatcherNotification uint16 = 0x0008
  454. LocateSetDirInfo uint16 = 0x0009
  455. LocateSetDirReply uint16 = 0x000A
  456. LocateGetDirInfo uint16 = 0x000B
  457. LocateGetDirReply uint16 = 0x000C
  458. LocateGroupCapabilityQuery uint16 = 0x000D
  459. LocateGroupCapabilityReply uint16 = 0x000E
  460. LocateSetKeywordInfo uint16 = 0x000F
  461. LocateSetKeywordReply uint16 = 0x0010
  462. LocateGetKeywordInfo uint16 = 0x0011
  463. LocateGetKeywordReply uint16 = 0x0012
  464. LocateFindListByEmail uint16 = 0x0013
  465. LocateFindListReply uint16 = 0x0014
  466. LocateUserInfoQuery2 uint16 = 0x0015
  467. LocateTypeSig uint32 = 0x00000001
  468. LocateTypeUnavailable uint32 = 0x00000002
  469. LocateTypeCapabilities uint32 = 0x00000004
  470. LocateTypeCerts uint32 = 0x00000008
  471. LocateTypeHtmlInfo uint32 = 0x00000400
  472. LocateTLVTagsInfoSigMime uint16 = 0x01
  473. LocateTLVTagsInfoSigData uint16 = 0x02
  474. LocateTLVTagsInfoUnavailableMime uint16 = 0x03
  475. LocateTLVTagsInfoUnavailableData uint16 = 0x04
  476. LocateTLVTagsInfoCapabilities uint16 = 0x05
  477. LocateTLVTagsInfoCerts uint16 = 0x06
  478. LocateTLVTagsInfoSigTime uint16 = 0x0A
  479. LocateTLVTagsInfoUnavailableTime uint16 = 0x0B
  480. LocateTLVTagsInfoSupportHostSig uint16 = 0x0C
  481. LocateTLVTagsInfoHtmlInfoData uint16 = 0x0E
  482. LocateTLVTagsInfoHtmlInfoType uint16 = 0x0D
  483. // LocateTLVTagsRightsMaxSigLen is the max signature length
  484. LocateTLVTagsRightsMaxSigLen uint16 = 0x01
  485. // LocateTLVTagsRightsMaxCapabilitiesLen is the max allowed # of full UUID capabilities
  486. LocateTLVTagsRightsMaxCapabilitiesLen uint16 = 0x02
  487. // LocateTLVTagsRightsMaxFindByEmailList is the maximum # of email addresses to look up at once
  488. LocateTLVTagsRightsMaxFindByEmailList uint16 = 0x03
  489. // LocateTLVTagsRightsMaxCertsLen is the largest CERT length for e2e crypto
  490. LocateTLVTagsRightsMaxCertsLen uint16 = 0x04
  491. // LocateTLVTagsRightsMaxMaxShortCapabilities is the max allowed # of short UUID capabilities allowed
  492. LocateTLVTagsRightsMaxMaxShortCapabilities uint16 = 0x05
  493. LocateGetDirReplyOK uint16 = 0x01 // Directory info lookup succeeded
  494. LocateGetDirReplyUnavailable uint16 = 0x02 // Directory info lookup unavailable
  495. )
  496. type SNAC_0x02_0x03_LocateRightsReply struct {
  497. TLVRestBlock
  498. }
  499. type SNAC_0x02_0x04_LocateSetInfo struct {
  500. TLVRestBlock
  501. }
  502. type SNAC_0x02_0x06_LocateUserInfoReply struct {
  503. TLVUserInfo
  504. LocateInfo TLVRestBlock
  505. }
  506. type SNAC_0x02_0x09_LocateSetDirInfo struct {
  507. TLVRestBlock
  508. }
  509. type SNAC_0x02_0x0A_LocateSetDirReply struct {
  510. Result uint16
  511. }
  512. type SNAC_0x02_0x0B_LocateGetDirInfo struct {
  513. ScreenName string `oscar:"len_prefix=uint8"`
  514. }
  515. type SNAC_0x02_0x0C_LocateGetDirReply struct {
  516. Status uint16
  517. TLVBlock
  518. }
  519. type SNAC_0x02_0x0F_LocateSetKeywordInfo struct {
  520. TLVRestBlock
  521. }
  522. type SNAC_0x02_0x10_LocateSetKeywordReply struct {
  523. // Unknown is a field whose purpose is not known
  524. Unknown uint16
  525. }
  526. type SNAC_0x02_0x05_LocateUserInfoQuery struct {
  527. Type uint16
  528. ScreenName string `oscar:"len_prefix=uint8"`
  529. }
  530. func (s SNAC_0x02_0x05_LocateUserInfoQuery) RequestProfile() bool {
  531. return s.Type&uint16(LocateTypeSig) == uint16(LocateTypeSig)
  532. }
  533. func (s SNAC_0x02_0x05_LocateUserInfoQuery) RequestAwayMessage() bool {
  534. return s.Type&uint16(LocateTypeUnavailable) == uint16(LocateTypeUnavailable)
  535. }
  536. type SNAC_0x02_0x15_LocateUserInfoQuery2 struct {
  537. Type2 uint32
  538. ScreenName string `oscar:"len_prefix=uint8"`
  539. }
  540. //
  541. // 0x03: Buddy
  542. //
  543. const (
  544. BuddyErr uint16 = 0x0001
  545. BuddyRightsQuery uint16 = 0x0002
  546. BuddyRightsReply uint16 = 0x0003
  547. BuddyAddBuddies uint16 = 0x0004
  548. BuddyDelBuddies uint16 = 0x0005
  549. BuddyWatcherListQuery uint16 = 0x0006
  550. BuddyWatcherListResponse uint16 = 0x0007
  551. BuddyWatcherSubRequest uint16 = 0x0008
  552. BuddyWatcherNotification uint16 = 0x0009
  553. BuddyRejectNotification uint16 = 0x000A
  554. BuddyArrived uint16 = 0x000B
  555. BuddyDeparted uint16 = 0x000C
  556. BuddyAddTempBuddies uint16 = 0x000F
  557. BuddyDelTempBuddies uint16 = 0x0010
  558. BuddyTLVTagsParmMaxBuddies uint16 = 0x01
  559. BuddyTLVTagsParmMaxWatchers uint16 = 0x02
  560. BuddyTLVTagsParmMaxIcqBroad uint16 = 0x03
  561. BuddyTLVTagsParmMaxTempBuddies uint16 = 0x04
  562. )
  563. type SNAC_0x03_0x02_BuddyRightsQuery struct {
  564. TLVRestBlock
  565. }
  566. type SNAC_0x03_0x03_BuddyRightsReply struct {
  567. TLVRestBlock
  568. }
  569. type SNAC_0x03_0x04_BuddyAddBuddies struct {
  570. Buddies []struct {
  571. ScreenName string `oscar:"len_prefix=uint8"`
  572. }
  573. }
  574. type SNAC_0x03_0x05_BuddyDelBuddies struct {
  575. Buddies []struct {
  576. ScreenName string `oscar:"len_prefix=uint8"`
  577. }
  578. }
  579. type SNAC_0x03_0x0B_BuddyArrived struct {
  580. TLVUserInfo
  581. }
  582. type SNAC_0x03_0x0C_BuddyDeparted struct {
  583. TLVUserInfo
  584. }
  585. type SNAC_0x03_0x0F_BuddyAddTempBuddies struct {
  586. Buddies []struct {
  587. ScreenName string `oscar:"len_prefix=uint8"`
  588. }
  589. }
  590. type SNAC_0x03_0x10_BuddyDelTempBuddies struct {
  591. Buddies []struct {
  592. ScreenName string `oscar:"len_prefix=uint8"`
  593. }
  594. }
  595. //
  596. // 0x04: ICBM
  597. //
  598. const (
  599. ICBMErr uint16 = 0x0001
  600. ICBMAddParameters uint16 = 0x0002
  601. ICBMDelParameters uint16 = 0x0003
  602. ICBMParameterQuery uint16 = 0x0004
  603. ICBMParameterReply uint16 = 0x0005
  604. ICBMChannelMsgToHost uint16 = 0x0006
  605. ICBMChannelMsgToClient uint16 = 0x0007
  606. ICBMEvilRequest uint16 = 0x0008
  607. ICBMEvilReply uint16 = 0x0009
  608. ICBMMissedCalls uint16 = 0x000A
  609. ICBMClientErr uint16 = 0x000B
  610. ICBMHostAck uint16 = 0x000C
  611. ICBMSinStored uint16 = 0x000D
  612. ICBMSinListQuery uint16 = 0x000E
  613. ICBMSinListReply uint16 = 0x000F
  614. ICBMOfflineRetrieve uint16 = 0x0010
  615. ICBMSinDelete uint16 = 0x0011
  616. ICBMNotifyRequest uint16 = 0x0012
  617. ICBMNotifyReply uint16 = 0x0013
  618. ICBMClientEvent uint16 = 0x0014
  619. ICBMOfflineRetrieveReply uint16 = 0x0017
  620. ICBMTLVAOLIMData uint16 = 0x02
  621. ICBMTLVRequestHostAck uint16 = 0x03
  622. ICBMTLVAutoResponse uint16 = 0x04
  623. ICBMTLVData uint16 = 0x05
  624. ICBMTLVStore uint16 = 0x06
  625. ICBMTLVICQBlob uint16 = 0x07
  626. ICBMTLVAvatarInfo uint16 = 0x08
  627. ICBMTLVWantAvatar uint16 = 0x09
  628. ICBMTLVMultiUser uint16 = 0x0A
  629. ICBMTLVWantEvents uint16 = 0x0B
  630. ICBMTLVSubscriptions uint16 = 0x0C
  631. ICBMTLVBART uint16 = 0x0D
  632. ICBMTLVHostImID uint16 = 0x10
  633. ICBMTLVHostImArgs uint16 = 0x11
  634. ICBMTLVSendTime uint16 = 0x16
  635. ICBMTLVFriendlyName uint16 = 0x17
  636. ICBMTLVAnonymous uint16 = 0x18
  637. ICBMTLVWidgetName uint16 = 0x19
  638. ICBMMessageEncodingASCII uint16 = 0x00 // ANSI ASCII -- ISO 646
  639. ICBMMessageEncodingUnicode uint16 = 0x02 // ISO 10646.USC-2 Unicode
  640. ICBMMessageEncodingLatin1 uint16 = 0x03 // ISO 8859-1
  641. ICBMExtendedMsgTypePlain uint8 = 0x01 // Plain text (simple) message
  642. ICBMExtendedMsgTypeChat uint8 = 0x02 // Chat request message
  643. ICBMExtendedMsgTypeFileReq uint8 = 0x03 // File request / file ok message
  644. ICBMExtendedMsgTypeURL uint8 = 0x04 // URL message (0xFE formatted)
  645. ICBMExtendedMsgTypeAuthReq uint8 = 0x06 // Authorization request message (0xFE formatted)
  646. ICBMExtendedMsgTypeAuthDeny uint8 = 0x07 // Authorization denied message (0xFE formatted)
  647. ICBMExtendedMsgTypeAuthOK uint8 = 0x08 // Authorization given message (empty)
  648. ICBMExtendedMsgTypeServer uint8 = 0x09 // Message from OSCAR server (0xFE formatted)
  649. ICBMExtendedMsgTypeAdded uint8 = 0x0C // "You-were-added" message (0xFE formatted)
  650. ICBMExtendedMsgTypeWWP uint8 = 0x0D // Web pager message (0xFE formatted)
  651. ICBMExtendedMsgTypeExpress uint8 = 0x0E // Email express message (0xFE formatted)
  652. ICBMExtendedMsgTypeContacts uint8 = 0x13 // Contact list message
  653. ICBMExtendedMsgTypePlugin uint8 = 0x1A // Plugin message described by text string
  654. ICBMExtendedMsgTypeAutoAway uint8 = 0xE8 // Auto away message
  655. ICBMExtendedMsgTypeAutoBusy uint8 = 0xE9 // Auto occupied message
  656. ICBMExtendedMsgTypeAutoNA uint8 = 0xEA // Auto not available message
  657. ICBMExtendedMsgTypeAutoDND uint8 = 0xEB // Auto do not disturb message
  658. ICBMExtendedMsgTypeAutoFFC uint8 = 0xEC // Auto free for chat message
  659. ICBMChannelIM uint16 = 0x01
  660. ICBMChannelRendezvous uint16 = 0x02
  661. ICBMChannelMIME uint16 = 0x03
  662. ICBMChannelICQ uint16 = 0x04
  663. ICBMChannelCoBrowser uint16 = 0x05
  664. ICBMMsgTypePlain uint8 = 0x01 // Plain text (simple) message
  665. ICBMMsgTypeChat uint8 = 0x02 // Chat request message
  666. ICBMMsgTypeFileReq uint8 = 0x03 // File request / file ok message
  667. ICBMMsgTypeUrl uint8 = 0x04 // URL message (0xFE formatted)
  668. ICBMMsgTypeAuthReq uint8 = 0x06 // Authorization request message (0xFE formatted)
  669. ICBMMsgTypeAuthDeny uint8 = 0x07 // Authorization denied message (0xFE formatted)
  670. ICBMMsgTypeAuthOK uint8 = 0x08 // Authorization given message (empty)
  671. ICBMMsgTypeServer uint8 = 0x09 // Message from OSCAR server (0xFE formatted)
  672. ICBMMsgTypeAdded uint8 = 0x0C // "You-were-added" message (0xFE formatted)
  673. ICBMMsgTypeWWP uint8 = 0x0D // Web pager message (0xFE formatted)
  674. ICBMMsgTypeEExpress uint8 = 0x0E // Email express message (0xFE formatted)
  675. ICBMMsgTypeContacts uint8 = 0x13 // Contact list message
  676. ICBMMsgTypePlugin uint8 = 0x1A // Plugin message described by text string
  677. ICBMMsgTypeAutoAway uint8 = 0xE8 // Auto away message
  678. ICBMMsgTypeAutoBusy uint8 = 0xE9 // Auto occupied message
  679. ICBMMsgTypeAutoNA uint8 = 0xEA // Auto not available message
  680. ICBMMsgTypeAutoDND uint8 = 0xEB // Auto do not disturb message
  681. ICBMMsgTypeAutoFFC uint8 = 0xEC // Auto free for chat message
  682. ICBMRdvMessagePropose uint16 = 0x00 // Propose a rendezvous
  683. ICBMRdvMessageCancel uint16 = 0x01 // Cancel a proposal you generated
  684. ICBMRdvMessageAccept uint16 = 0x02 // Accept a proposal someone else generated
  685. ICBMRdvMessageNak uint16 = 0x03 // NOT CURRENTLY DOCUMENTED
  686. ICBMRdvCancelReasonsUnknown uint16 = 0x00 // Reason not specified
  687. ICBMRdvCancelReasonsUserCancel uint16 = 0x01 // Recipient user declined
  688. ICBMRdvCancelReasonsTimeout uint16 = 0x02 // Timeout
  689. ICBMRdvCancelReasonsAcceptedElsewhere uint16 = 0x03 // Proposal was accepted by a different instance of the user
  690. ICBMRdvTLVTagsRdvChan uint16 = 0x0001 // uint16 (word) ICBM channel on which the rendezvous is to occur
  691. ICBMRdvTLVTagsRdvIP uint16 = 0x0002 // uint32 (dword) IP address proposed for the rendezvous
  692. ICBMRdvTLVTagsRequesterIP uint16 = 0x0003 // uint32 (dword) IP address of the proposing client
  693. ICBMRdvTLVTagsVerifiedIP uint16 = 0x0004 // uint32 (dword) IP address of the proposing client as seen by server; NOTE - this TLV may only be added by the server
  694. ICBMRdvTLVTagsPort uint16 = 0x0005 // uint16 (word) Port value of the client for rendezvous
  695. ICBMRdvTLVTagsDownloadURL uint16 = 0x0006 // string URL for downloading software to support the service
  696. ICBMRdvTLVTagsDownloadURL2 uint16 = 0x0007 // string NOT CURRENTLY DOCUMENTED
  697. ICBMRdvTLVTagsVerifiedDownloadURL uint16 = 0x0008 // string Same as DOWNLOAD_URL, but added by server if the service is well known; Note - this TLV may only be added by the server
  698. ICBMRdvTLVTagsSeqNum uint16 = 0x000A // uint16 (word) Identifies which proposal this is in the rendezvous conversation; the initial proposal has sequence_num 1; NOTE - this tag is required in *all* rendezvous *proposal* payloads and may only occur in proposal payloads; each proposal applying to a given rendezvous cookie increments the sequence_num by one
  699. ICBMRdvTLVTagsCancelReason uint16 = 0x000B // uint16 (word) [Class: ICBM__RENDEZVOUS_CANCEL_REASONS] Reason for cancelling a rendezvous; this tag must be present in all RENDEZVOUS_CANCEL payloads.
  700. ICBMRdvTLVTagsInvitation uint16 = 0x000C // string Text inviting the other player to join
  701. ICBMRdvTLVTagsInviteMIMECharset uint16 = 0x000D // string Charset used by the data
  702. ICBMRdvTLVTagsInviteMIMELang uint16 = 0x000E // string Language used by the data
  703. ICBMRdvTLVTagsRequestHostChk uint16 = 0x000F // empty Requests that the server check caps for recipient
  704. ICBMRdvTLVTagsUseARS uint16 = 0x0010 // empty Requests that the Rendezvous Server be used as a transport for the data
  705. ICBMRdvTLVTagsRequestSecure uint16 = 0x0011 // empty Requests that SSL be used for the connection
  706. ICBMRdvTLVTagsMaxProtoVersion uint16 = 0x0012 // uint16 (word) Maximum application protocol version supported
  707. ICBMRdvTLVTagsMinProtoVersion uint16 = 0x0013 // uint16 (word) Minimum application protocol version supported
  708. ICBMRdvTLVTagsCounterReason uint16 = 0x0014 // uint16 (word) Reason for a counter proposal
  709. ICBMRdvTLVTagsInviteMIMEType uint16 = 0x0015 // string Content-type used by the data
  710. ICBMRdvTLVTagsIPXOR uint16 = 0x0016 // uint32 (dword) Contains IP_ADDR ^ 0xFFFFFFFF - Used with recent clients to ensure that the IP_ADDR tlv is not tampered with or modified by a NAT since some NATs will change the IP_ADDR tlv when the proposal is sent
  711. ICBMRdvTLVTagsPortXOR uint16 = 0x0017 // uint16 (word) PORT ^ 0xFFFF - Used with recent clients to ensure that the PORT tlv is not tampered with or modified by a NAT since some NATs will change the PORT tlv when the proposal is sent
  712. ICBMRdvTLVTagsAddrList uint16 = 0x0018 // Array of string08 List of "IP port" pairs to try
  713. ICBMRdvTLVTagsSessID uint16 = 0x0019 // string Identifier for session
  714. ICBMRdvTLVTagsRolloverID uint16 = 0x001A // string Identifier of session to rollover
  715. ICBMRdvTLVTagsSvcData uint16 = 0x2711 // blob Service specific data
  716. ICBMSubErrRemoteIMOff uint16 = 0x0001 // Used with NOT_LOGGED_ON
  717. ICBMSubErrRemoteRestrictedByPC uint16 = 0x0002 // Used with NOT_LOGGED_ON; the remote side denied because of parental controls
  718. ICBMSubErrNeedSMSLegalToSend uint16 = 0x0003 // User tried to send a message to an SMS user and is required to accept the legal text first
  719. ICBMSubErrSMSWithoutDisclaimer uint16 = 0x0004 // Client tried to send a message to an SMS user without the character counter being displayed
  720. ICBMSubErrSMSCountryNotAllowed uint16 = 0x0005 // Client tried to send a message to an SMS user but the SMS matrix said the country code combination not permitted
  721. ICBMSubErrSMSUnknownCountry uint16 = 0x0008 // Client tried to send to an SMS user but the server could not determine the country
  722. ICBMSubErrCannotInitiateIM uint16 = 0x0009 // An IM cannot be initiated by a BOT
  723. ICBMSubErrIMNotAllowed uint16 = 0x000A // An IM is not allowed by a consumer BOT to a user
  724. ICBMSubErrCannotIMUsageLimited uint16 = 0x000B // An IM is not allowed by a consumer BOT due to reaching a generic usage limit
  725. ICBMSubErrCannotIMDailyLimited uint16 = 0x000C // An IM is not allowed by a consumer BOT due to reaching the daily usage limit
  726. ICBMSubErrCannotIMMonthlyLimited uint16 = 0x000D // An IM is not allowed by a consumer BOT due to reaching the monthly usage limit
  727. ICBMSubErrOfflineIMNotAccepted uint16 = 0x000E // User does not accept offline IMs
  728. ICBMSubErrOfflineIMExceedMax uint16 = 0x000F // Exceeded max storage limit
  729. )
  730. // ICBMCh1Fragment represents an ICBM channel 1 (instant message) message
  731. // component.
  732. type ICBMCh1Fragment struct {
  733. ID uint8
  734. Version uint8
  735. Payload []byte `oscar:"len_prefix=uint16"`
  736. }
  737. type ICBMCh2Fragment struct {
  738. Type uint16
  739. Cookie [8]byte
  740. Capability [16]byte
  741. TLVRestBlock
  742. }
  743. type ICBMRoomInfo struct {
  744. Exchange uint16
  745. Cookie string `oscar:"len_prefix=uint8"`
  746. Instance uint16
  747. }
  748. // ICBMCh1Message represents the text component of an ICBM channel 1 (instant
  749. // message) message.
  750. type ICBMCh1Message struct {
  751. Charset uint16
  752. Language uint16
  753. Text []byte
  754. }
  755. // ICBMCh4Message represents an ICBM channel 4 (ICQ) message component.
  756. type ICBMCh4Message struct {
  757. UIN uint32
  758. MessageType uint8
  759. Flags uint8
  760. Message string `oscar:"len_prefix=uint16,nullterm"`
  761. }
  762. type SNAC_0x04_0x02_ICBMAddParameters struct {
  763. Channel uint16
  764. ICBMFlags uint32
  765. MaxIncomingICBMLen uint16
  766. MaxSourceEvil uint16
  767. MaxDestinationEvil uint16
  768. MinInterICBMInterval uint32
  769. }
  770. type SNAC_0x04_0x05_ICBMParameterReply struct {
  771. MaxSlots uint16
  772. ICBMFlags uint32
  773. MaxIncomingICBMLen uint16
  774. MaxSourceEvil uint16
  775. MaxDestinationEvil uint16
  776. MinInterICBMInterval uint32
  777. }
  778. type SNAC_0x04_0x06_ICBMChannelMsgToHost struct {
  779. Cookie uint64
  780. ChannelID uint16
  781. ScreenName string `oscar:"len_prefix=uint8"`
  782. TLVRestBlock
  783. }
  784. type SNAC_0x04_0x07_ICBMChannelMsgToClient struct {
  785. Cookie uint64
  786. ChannelID uint16
  787. TLVUserInfo
  788. TLVRestBlock
  789. }
  790. // ICBMFragmentList creates an ICBM fragment list for an instant message
  791. // payload.
  792. func ICBMFragmentList(text string) ([]ICBMCh1Fragment, error) {
  793. msg := ICBMCh1Message{
  794. Charset: ICBMMessageEncodingASCII,
  795. Language: 0, // not clear what this means, but it works
  796. Text: []byte(text),
  797. }
  798. msgBuf := bytes.Buffer{}
  799. if err := MarshalBE(msg, &msgBuf); err != nil {
  800. return nil, fmt.Errorf("unable to marshal ICBM message: %w", err)
  801. }
  802. return []ICBMCh1Fragment{
  803. {
  804. ID: 5, // 5 = capabilities
  805. Version: 1,
  806. Payload: []byte{1, 1, 2}, // 1 = text
  807. },
  808. {
  809. ID: 1, // 1 = message text
  810. Version: 1,
  811. Payload: msgBuf.Bytes(),
  812. },
  813. }, nil
  814. }
  815. // UnmarshalICBMMessageText extracts message text from an ICBM fragment list.
  816. // Param b is a slice from TLV wire.ICBMTLVAOLIMData.
  817. func UnmarshalICBMMessageText(b []byte) (string, error) {
  818. var frags []ICBMCh1Fragment
  819. if err := UnmarshalBE(&frags, bytes.NewBuffer(b)); err != nil {
  820. return "", fmt.Errorf("unable to unmarshal ICBM fragment: %w", err)
  821. }
  822. for _, frag := range frags {
  823. if frag.ID == 1 { // 1 = message text
  824. msg := ICBMCh1Message{}
  825. err := UnmarshalBE(&msg, bytes.NewBuffer(frag.Payload))
  826. if err != nil {
  827. err = fmt.Errorf("unable to unmarshal ICBM message: %w", err)
  828. }
  829. return string(msg.Text), err
  830. }
  831. }
  832. return "", errors.New("unable to find message fragment")
  833. }
  834. // MarshalICBMFragmentList serializes an ICBM fragment list for an ICBM channel 1
  835. // message. This is the inverse of UnmarshalICBMMessageText's internal unmarshaling.
  836. func MarshalICBMFragmentList(frags []ICBMCh1Fragment) ([]byte, error) {
  837. buf := bytes.Buffer{}
  838. if err := MarshalBE(frags, &buf); err != nil {
  839. return nil, fmt.Errorf("unable to marshal ICBM fragments: %w", err)
  840. }
  841. return buf.Bytes(), nil
  842. }
  843. type SNAC_0x04_0x08_ICBMEvilRequest struct {
  844. SendAs uint16
  845. ScreenName string `oscar:"len_prefix=uint8"`
  846. }
  847. type SNAC_0x04_0x09_ICBMEvilReply struct {
  848. EvilDeltaApplied uint16
  849. UpdatedEvilValue uint16
  850. }
  851. type SNAC_0x04_0x0B_ICBMClientErr struct {
  852. Cookie uint64
  853. ChannelID uint16
  854. ScreenName string `oscar:"len_prefix=uint8"`
  855. Code uint16
  856. ErrInfo []byte
  857. }
  858. type SNAC_0x04_0x0C_ICBMHostAck struct {
  859. Cookie uint64
  860. ChannelID uint16
  861. ScreenName string `oscar:"len_prefix=uint8"`
  862. }
  863. type SNAC_0x04_0x14_ICBMClientEvent struct {
  864. Cookie uint64
  865. ChannelID uint16
  866. ScreenName string `oscar:"len_prefix=uint8"`
  867. Event uint16
  868. }
  869. type SNAC_0x04_0x0A_ICBMOfflineRetrieve struct{}
  870. type SNAC_0x04_0x17_ICBMOfflineRetrieveReply struct{}
  871. //
  872. // 0x05: Advert
  873. //
  874. const (
  875. AdvertErr uint16 = 0x0001
  876. AdvertAdsQuery uint16 = 0x0002
  877. AdvertAdsReply uint16 = 0x0003
  878. )
  879. //
  880. // 0x06: Invite
  881. //
  882. const (
  883. InviteErr uint16 = 0x0001
  884. InviteRequestQuery uint16 = 0x0002
  885. InviteRequestReply uint16 = 0x0003
  886. )
  887. //
  888. // 0x07: Admin
  889. //
  890. const (
  891. AdminErr uint16 = 0x0001
  892. AdminInfoQuery uint16 = 0x0002
  893. AdminInfoReply uint16 = 0x0003
  894. AdminInfoChangeRequest uint16 = 0x0004
  895. AdminInfoChangeReply uint16 = 0x0005
  896. AdminAcctConfirmRequest uint16 = 0x0006
  897. AdminAcctConfirmReply uint16 = 0x0007
  898. AdminAcctDeleteRequest uint16 = 0x0008
  899. AdminAcctDeleteReply uint16 = 0x0009
  900. AdminInfoErrorValidateNickName uint16 = 0x0001
  901. AdminInfoErrorValidatePassword uint16 = 0x0002
  902. AdminInfoErrorValidateEmail uint16 = 0x0003
  903. AdminInfoErrorServiceTempUnavailable uint16 = 0x0004
  904. AdminInfoErrorFieldChangeTempUnavailable uint16 = 0x0005
  905. AdminInfoErrorInvalidNickName uint16 = 0x0006
  906. AdminInfoErrorInvalidPassword uint16 = 0x0007
  907. AdminInfoErrorInvalidEmail uint16 = 0x0008
  908. AdminInfoErrorInvalidRegistrationPreference uint16 = 0x0009
  909. AdminInfoErrorInvalidOldPassword uint16 = 0x000A
  910. AdminInfoErrorInvalidNickNameLength uint16 = 0x000B
  911. AdminInfoErrorInvalidPasswordLength uint16 = 0x000C
  912. AdminInfoErrorInvalidEmailLength uint16 = 0x000D
  913. AdminInfoErrorInvalidOldPasswordLength uint16 = 0x000E
  914. AdminInfoErrorNeedOldPassword uint16 = 0x000F
  915. AdminInfoErrorReadOnlyField uint16 = 0x0010
  916. AdminInfoErrorWriteOnlyField uint16 = 0x0011
  917. AdminInfoErrorUnsupportedType uint16 = 0x0012
  918. AdminInfoErrorAllOtherErrors uint16 = 0x0013
  919. AdminInfoErrorBadSnac uint16 = 0x0014
  920. AdminInfoErrorInvalidAccount uint16 = 0x0015
  921. AdminInfoErrorDeletedAccount uint16 = 0x0016
  922. AdminInfoErrorExpiredAccount uint16 = 0x0017
  923. AdminInfoErrorNoDatabaseAccess uint16 = 0x0018
  924. AdminInfoErrorInvalidDatabaseFields uint16 = 0x0019
  925. AdminInfoErrorBadDatabaseStatus uint16 = 0x001A
  926. AdminInfoErrorMigrationCancel uint16 = 0x001B
  927. AdminInfoErrorInternalError uint16 = 0x001C
  928. AdminInfoErrorPendingRequest uint16 = 0x001D
  929. AdminInfoErrorNotDTStatus uint16 = 0x001E
  930. AdminInfoErrorOutstandingConfirm uint16 = 0x001F
  931. AdminInfoErrorNoEmailAddress uint16 = 0x0020
  932. AdminInfoErrorOverLimit uint16 = 0x0021
  933. AdminInfoErrorEmailHostFail uint16 = 0x0022
  934. AdminInfoErrorDNSFail uint16 = 0x0023
  935. AdminInfoRegStatusNoDisclosure uint16 = 0x01
  936. AdminInfoRegStatusLimitDisclosure uint16 = 0x02
  937. AdminInfoRegStatusFullDisclosure uint16 = 0x03
  938. AdminInfoPermissionsReadOnly1 uint16 = 0x01
  939. AdminInfoPermissionsReadOnly2 uint16 = 0x02
  940. AdminInfoPermissionsReadWrite uint16 = 0x03
  941. AdminAcctConfirmStatusEmailSent uint16 = 0x00
  942. AdminAcctConfirmStatusAlreadyConfirmed uint16 = 0x1E
  943. AdminAcctConfirmStatusServerError uint16 = 0x23
  944. AdminTLVScreenNameFormatted uint16 = 0x01
  945. AdminTLVNewPassword uint16 = 0x02
  946. AdminTLVUrl uint16 = 0x04
  947. AdminTLVErrorCode uint16 = 0x08
  948. AdminTLVEmailAddress uint16 = 0x11
  949. AdminTLVOldPassword uint16 = 0x12
  950. AdminTLVRegistrationStatus uint16 = 0x13
  951. )
  952. // Used when client wants to get its account information
  953. // - AdminTLVScreenNameFormatted
  954. // - AdminTLVEmailAddress
  955. // - AdminTLVRegistrationStatus
  956. type SNAC_0x07_0x02_AdminInfoQuery struct {
  957. TLVRestBlock
  958. }
  959. type SNAC_0x07_0x03_AdminInfoReply struct {
  960. Permissions uint16
  961. TLVBlock
  962. }
  963. // AdminTLVScreenNameFormatted - change screenname formatting
  964. // AdminTLVEmailAddress - change account email
  965. // AdminTLVRegistrationStatus - change registration status
  966. // AdminTLVNewPassword, AdminTLVOldPassword - change password
  967. type SNAC_0x07_0x04_AdminInfoChangeRequest struct {
  968. TLVRestBlock
  969. }
  970. type SNAC_0x07_0x05_AdminChangeReply struct {
  971. Permissions uint16
  972. TLVBlock
  973. }
  974. type SNAC_0x07_0x06_AdminConfirmRequest struct{}
  975. type SNAC_0x07_0x07_AdminConfirmReply struct {
  976. Status uint16
  977. TLV
  978. }
  979. //
  980. // 0x08: Popup
  981. //
  982. const (
  983. PopupErr uint16 = 0x0001
  984. PopupDisplay uint16 = 0x0002
  985. )
  986. //
  987. // 0x09: PermitDeny
  988. //
  989. const (
  990. PermitDenyErr uint16 = 0x0001
  991. PermitDenyRightsQuery uint16 = 0x0002
  992. PermitDenyRightsReply uint16 = 0x0003
  993. PermitDenySetGroupPermitMask uint16 = 0x0004
  994. PermitDenyAddPermListEntries uint16 = 0x0005
  995. PermitDenyDelPermListEntries uint16 = 0x0006
  996. PermitDenyAddDenyListEntries uint16 = 0x0007
  997. PermitDenyDelDenyListEntries uint16 = 0x0008
  998. PermitDenyBosErr uint16 = 0x0009
  999. PermitDenyAddTempPermitListEntries uint16 = 0x000A
  1000. PermitDenyDelTempPermitListEntries uint16 = 0x000B
  1001. PermitDenyTLVMaxPermits uint16 = 0x01
  1002. PermitDenyTLVMaxDenies uint16 = 0x02
  1003. PermitDenyTLVMaxTempPermits uint16 = 0x03
  1004. )
  1005. type SNAC_0x09_0x03_PermitDenyRightsReply struct {
  1006. TLVRestBlock
  1007. }
  1008. type SNAC_0x09_0x05_PermitDenyAddPermListEntries struct {
  1009. Users []struct {
  1010. ScreenName string `oscar:"len_prefix=uint8"`
  1011. }
  1012. }
  1013. type SNAC_0x09_0x06_PermitDenyDelPermListEntries struct {
  1014. Users []struct {
  1015. ScreenName string `oscar:"len_prefix=uint8"`
  1016. }
  1017. }
  1018. type SNAC_0x09_0x07_PermitDenyAddDenyListEntries struct {
  1019. Users []struct {
  1020. ScreenName string `oscar:"len_prefix=uint8"`
  1021. }
  1022. }
  1023. type SNAC_0x09_0x08_PermitDenyDelDenyListEntries struct {
  1024. Users []struct {
  1025. ScreenName string `oscar:"len_prefix=uint8"`
  1026. }
  1027. }
  1028. type SNAC_0x09_0x04_PermitDenySetGroupPermitMask struct {
  1029. PermMask uint32
  1030. }
  1031. func (s SNAC_0x09_0x04_PermitDenySetGroupPermitMask) IsFlagSet(flag uint16) bool {
  1032. return flag&uint16(s.PermMask) == flag
  1033. }
  1034. //
  1035. // 0x0A: UserLookup
  1036. //
  1037. const (
  1038. UserLookupErr uint16 = 0x0001
  1039. UserLookupFindByEmail uint16 = 0x0002
  1040. UserLookupFindReply uint16 = 0x0003
  1041. UserLookupErrNoUserFound uint16 = 0x0014
  1042. UserLookupTLVEmailAddress uint16 = 0x0001
  1043. )
  1044. type SNAC_0x0A_0x02_UserLookupFindByEmail struct {
  1045. Email []byte
  1046. }
  1047. type SNAC_0x0A_0x03_UserLookupFindReply struct {
  1048. TLVRestBlock
  1049. }
  1050. //
  1051. // 0x0B: Stats
  1052. //
  1053. const (
  1054. StatsErr uint16 = 0x0001
  1055. StatsSetMinReportInterval uint16 = 0x0002
  1056. StatsReportEvents uint16 = 0x0003
  1057. StatsReportAck uint16 = 0x0004
  1058. )
  1059. type SNAC_0x0B_0x02_StatsSetMinReportInterval struct {
  1060. MinReportInterval uint16
  1061. }
  1062. type SNAC_0x0B_0x03_StatsReportEvents struct {
  1063. TLVRestBlock
  1064. }
  1065. type SNAC_0x0B_0x04_StatsReportAck struct {
  1066. }
  1067. //
  1068. // 0x0C: Translate
  1069. //
  1070. const (
  1071. TranslateErr uint16 = 0x0001
  1072. TranslateRequest uint16 = 0x0002
  1073. TranslateReply uint16 = 0x0003
  1074. )
  1075. //
  1076. // 0x0D: ChatNav
  1077. //
  1078. const (
  1079. ChatNavErr uint16 = 0x0001
  1080. ChatNavRequestChatRights uint16 = 0x0002
  1081. ChatNavRequestExchangeInfo uint16 = 0x0003
  1082. ChatNavRequestRoomInfo uint16 = 0x0004
  1083. ChatNavRequestMoreRoomInfo uint16 = 0x0005
  1084. ChatNavRequestOccupantList uint16 = 0x0006
  1085. ChatNavSearchForRoom uint16 = 0x0007
  1086. ChatNavCreateRoom uint16 = 0x0008
  1087. ChatNavNavInfo uint16 = 0x0009
  1088. ChatNavTLVMaxConcurrentRooms uint16 = 0x0002
  1089. ChatNavTLVExchangeInfo uint16 = 0x0003
  1090. ChatNavTLVRoomInfo uint16 = 0x0004
  1091. )
  1092. type SNAC_0x0D_0x03_ChatNavRequestExchangeInfo struct {
  1093. Exchange uint16
  1094. }
  1095. type SNAC_0x0D_0x04_ChatNavRequestRoomInfo struct {
  1096. Exchange uint16
  1097. Cookie string `oscar:"len_prefix=uint8"`
  1098. InstanceNumber uint16
  1099. DetailLevel uint8
  1100. }
  1101. type SNAC_0x0D_0x09_ChatNavNavInfo struct {
  1102. TLVRestBlock
  1103. }
  1104. type SNAC_0x0D_0x09_TLVExchangeInfo struct {
  1105. Identifier uint16
  1106. TLVBlock
  1107. }
  1108. //
  1109. // 0x0E: Chat
  1110. //
  1111. const (
  1112. ChatErr uint16 = 0x0001
  1113. ChatRoomInfoUpdate uint16 = 0x0002
  1114. ChatUsersJoined uint16 = 0x0003
  1115. ChatUsersLeft uint16 = 0x0004
  1116. ChatChannelMsgToHost uint16 = 0x0005
  1117. ChatChannelMsgToClient uint16 = 0x0006
  1118. ChatEvilRequest uint16 = 0x0007
  1119. ChatEvilReply uint16 = 0x0008
  1120. ChatClientErr uint16 = 0x0009
  1121. ChatPauseRoomReq uint16 = 0x000A
  1122. ChatPauseRoomAck uint16 = 0x000B
  1123. ChatResumeRoom uint16 = 0x000C
  1124. ChatShowMyRow uint16 = 0x000D
  1125. ChatShowRowByUsername uint16 = 0x000E
  1126. ChatShowRowByNumber uint16 = 0x000F
  1127. ChatShowRowByName uint16 = 0x0010
  1128. ChatRowInfo uint16 = 0x0011
  1129. ChatListRows uint16 = 0x0012
  1130. ChatRowListInfo uint16 = 0x0013
  1131. ChatMoreRows uint16 = 0x0014
  1132. ChatMoveToRow uint16 = 0x0015
  1133. ChatToggleChat uint16 = 0x0016
  1134. ChatSendQuestion uint16 = 0x0017
  1135. ChatSendComment uint16 = 0x0018
  1136. ChatTallyVote uint16 = 0x0019
  1137. ChatAcceptBid uint16 = 0x001A
  1138. ChatSendInvite uint16 = 0x001B
  1139. ChatDeclineInvite uint16 = 0x001C
  1140. ChatAcceptInvite uint16 = 0x001D
  1141. ChatNotifyMessage uint16 = 0x001E
  1142. ChatGotoRow uint16 = 0x001F
  1143. ChatStageUserJoin uint16 = 0x0020
  1144. ChatStageUserLeft uint16 = 0x0021
  1145. ChatUnnamedSnac22 uint16 = 0x0022
  1146. ChatClose uint16 = 0x0023
  1147. ChatUserBan uint16 = 0x0024
  1148. ChatUserUnban uint16 = 0x0025
  1149. ChatJoined uint16 = 0x0026
  1150. ChatUnnamedSnac27 uint16 = 0x0027
  1151. ChatUnnamedSnac28 uint16 = 0x0028
  1152. ChatUnnamedSnac29 uint16 = 0x0029
  1153. ChatRoomInfoOwner uint16 = 0x0030
  1154. ChatTLVPublicWhisperFlag uint16 = 0x01
  1155. ChatTLVWhisperToUser uint16 = 0x02
  1156. ChatTLVSenderInformation uint16 = 0x03
  1157. ChatTLVMessageInfo uint16 = 0x05
  1158. ChatTLVEnableReflectionFlag uint16 = 0x06
  1159. ChatTLVMessageInfoEncoding uint16 = 0x02
  1160. ChatTLVMessageInfoLang uint16 = 0x03
  1161. ChatTLVMessageInfoText uint16 = 0x01
  1162. // referenced from protocols/oscar/family_chatnav.c in lib purple
  1163. ChatRoomTLVClassPerms uint16 = 0x02
  1164. ChatRoomTLVMaxConcurrentRooms uint16 = 0x03 // required by aim 2.x-3.x
  1165. ChatRoomTLVMaxNameLen uint16 = 0x04
  1166. ChatRoomTLVFullyQualifiedName uint16 = 0x6A
  1167. ChatRoomTLVCreateTime uint16 = 0xCA
  1168. ChatRoomTLVFlags uint16 = 0xC9
  1169. ChatRoomTLVMaxMsgLen uint16 = 0xD1
  1170. ChatRoomTLVMaxOccupancy uint16 = 0xD2
  1171. ChatRoomTLVRoomName uint16 = 0xD3
  1172. ChatRoomTLVNavCreatePerms uint16 = 0xD5
  1173. ChatRoomTLVCharSet1 uint16 = 0xD6
  1174. ChatRoomTLVLang1 uint16 = 0xD7
  1175. ChatRoomTLVCharSet2 uint16 = 0xD8
  1176. ChatRoomTLVLang2 uint16 = 0xD9
  1177. ChatRoomTLVMaxMsgVisLen uint16 = 0xDA
  1178. )
  1179. type SNAC_0x0E_0x02_ChatRoomInfoUpdate struct {
  1180. Exchange uint16
  1181. Cookie string `oscar:"len_prefix=uint8"`
  1182. InstanceNumber uint16
  1183. DetailLevel uint8
  1184. TLVBlock
  1185. }
  1186. type SNAC_0x0E_0x03_ChatUsersJoined struct {
  1187. Users []TLVUserInfo
  1188. }
  1189. type SNAC_0x0E_0x04_ChatUsersLeft struct {
  1190. Users []TLVUserInfo
  1191. }
  1192. type SNAC_0x0E_0x05_ChatChannelMsgToHost struct {
  1193. Cookie uint64
  1194. Channel uint16
  1195. TLVRestBlock
  1196. }
  1197. type SNAC_0x0E_0x06_ChatChannelMsgToClient struct {
  1198. Cookie uint64
  1199. Channel uint16
  1200. TLVRestBlock
  1201. }
  1202. // UnmarshalChatMessageText extracts message text from a chat message. Param b
  1203. // is a slice from TLV wire.ChatTLVMessageInfo.
  1204. func UnmarshalChatMessageText(b []byte) (string, error) {
  1205. block := TLVRestBlock{}
  1206. if err := UnmarshalBE(&block, bytes.NewReader(b)); err != nil {
  1207. return "", fmt.Errorf("UnmarshalBE: %w", err)
  1208. }
  1209. b, hasMsg := block.Bytes(ChatTLVMessageInfoText)
  1210. if !hasMsg {
  1211. return "", errors.New("SNAC(0x0E,0x05) has no chat msg text TLV")
  1212. }
  1213. return string(b), nil
  1214. }
  1215. //
  1216. // 0x0F: ODir
  1217. //
  1218. const (
  1219. ODirErr uint16 = 0x0001
  1220. ODirInfoQuery uint16 = 0x0002
  1221. ODirInfoReply uint16 = 0x0003
  1222. ODirKeywordListQuery uint16 = 0x0004
  1223. ODirKeywordListReply uint16 = 0x0005
  1224. ODirTLVFirstName uint16 = 0x0001 // The first name of the individual being searched.
  1225. ODirTLVLastName uint16 = 0x0002 // The last name of the individual being searched.
  1226. ODirTLVMiddleName uint16 = 0x0003 // The middle name of the individual being searched.
  1227. ODirTLVMaidenName uint16 = 0x0004 // The maiden name of the individual being searched.
  1228. ODirTLVEmailAddress uint16 = 0x0005 // The email address you're searching for.
  1229. ODirTLVCountry uint16 = 0x0006 // The country where the individual resides.
  1230. ODirTLVState uint16 = 0x0007 // The state where the individual resides.
  1231. ODirTLVCity uint16 = 0x0008 // The city where the individual resides.
  1232. ODirTLVScreenName uint16 = 0x0009 // The screen name of the individual being searched.
  1233. ODirTLVSearchType uint16 = 0x000a // Likely denotes the search type: 0x0000 for "name and other criteria" search, 0x0001 for "email address" or "interest" search.
  1234. ODirTLVInterest uint16 = 0x000b // The interest or hobby of the individual being searched.
  1235. ODirTLVNickName uint16 = 0x000c // The nickname of the individual being searched.
  1236. ODirTLVZIP uint16 = 0x000d // The ZIP code where the individual resides.
  1237. ODirTLVRegion uint16 = 0x001c // Encodes region information, possibly as 8 bytes in "us-ascii."
  1238. ODirTLVAddress uint16 = 0x0021 // The street address where the individual resides.
  1239. ODirKeywordCategory uint8 = 0x01
  1240. ODirKeyword uint8 = 0x02
  1241. ODirSearchByNameAndAddress uint16 = 0x0000
  1242. ODirSearchByEmailOrInterest uint16 = 0x0001
  1243. ODirSearchResponseUnavailable1 uint16 = 0x01 // Search is unavailable
  1244. ODirSearchResponseUnavailable2 uint16 = 0x02 // Search is unavailable (same as above)
  1245. ODirSearchResponseTooManyResults uint16 = 0x03 // Too many results returned, narrow search
  1246. ODirSearchResponseNameMissing uint16 = 0x04 // Missing first or last name
  1247. ODirSearchResponseOK uint16 = 0x05 // Successful search
  1248. )
  1249. type SNAC_0x0F_0x02_InfoQuery struct {
  1250. TLVRestBlock
  1251. }
  1252. type SNAC_0x0F_0x03_InfoReply struct {
  1253. Status uint16
  1254. Unknown uint16
  1255. Results struct {
  1256. List []TLVBlock `oscar:"count_prefix=uint16"`
  1257. } `oscar:"count_prefix=uint16"`
  1258. }
  1259. type SNAC_0x0F_0x04_KeywordListQuery struct{}
  1260. type SNAC_0x0F_0x04_KeywordListReply struct {
  1261. Status uint16
  1262. Interests []ODirKeywordListItem `oscar:"count_prefix=uint16"`
  1263. }
  1264. type ODirKeywordListItem struct {
  1265. // Type is the item type (parent category = 1, keyword = 2).
  1266. Type uint8
  1267. // ID is the ID of the keyword or category. If item type is category, then
  1268. // it's the category ID. If item type is keyword, then it's the parent
  1269. // category ID. If it's a top-level keyword, value is 0.
  1270. ID uint8
  1271. // Name is the keyword or category name.
  1272. Name string `oscar:"len_prefix=uint16"`
  1273. }
  1274. //
  1275. // 0x10: BART
  1276. //
  1277. //
  1278. const (
  1279. BARTTypesBuddyIconSmall uint16 = 0x00
  1280. BARTTypesBuddyIcon uint16 = 0x01
  1281. BARTTypesStatusStr uint16 = 0x02
  1282. BARTTypesArriveSound uint16 = 0x03
  1283. BARTTypesRichName uint16 = 0x04
  1284. BARTTypesSuperIcon uint16 = 0x05
  1285. BARTTypesRadioStation uint16 = 0x06
  1286. BARTTypesSuperIconTrigger uint16 = 0x07
  1287. BARTTypesStatusTextLink uint16 = 0x09
  1288. BARTTypesLocation uint16 = 0x0B
  1289. BARTTypesBuddyIconBig uint16 = 0x0C
  1290. BARTTypesStatusTextTimestamp uint16 = 0x0D
  1291. BARTTypesCurrentAvtrack uint16 = 0x0F
  1292. BARTTypesDepartSound uint16 = 0x60
  1293. BARTTypesImBackground uint16 = 0x80
  1294. BARTTypesImChrome uint16 = 0x81
  1295. BARTTypesImSkin uint16 = 0x82
  1296. BARTTypesImSound uint16 = 0x83
  1297. BARTTypesBadge uint16 = 0x84
  1298. BARTTypesBadgeUrl uint16 = 0x85
  1299. BARTTypesImInitialSound uint16 = 0x86
  1300. BARTTypesFlashWallpaper uint16 = 0x88
  1301. BARTTypesImmersiveWallpaper uint16 = 0x89
  1302. BARTTypesBuddylistBackground uint16 = 0x100
  1303. BARTTypesBuddylistImage uint16 = 0x101
  1304. BARTTypesBuddylistSkin uint16 = 0x102
  1305. BARTTypesSmileySet uint16 = 0x400
  1306. BARTTypesEncrCertChain uint16 = 0x402
  1307. BARTTypesSignCertChain uint16 = 0x403
  1308. BARTTypesGatewayCert uint16 = 0x404
  1309. )
  1310. const (
  1311. BARTErr uint16 = 0x0001
  1312. BARTUploadQuery uint16 = 0x0002
  1313. BARTUploadReply uint16 = 0x0003
  1314. BARTDownloadQuery uint16 = 0x0004
  1315. BARTDownloadReply uint16 = 0x0005
  1316. BARTDownload2Query uint16 = 0x0006
  1317. BARTDownload2Reply uint16 = 0x0007
  1318. )
  1319. const (
  1320. BARTFlagsKnown uint8 = 0x00
  1321. BARTFlagsCustom uint8 = 0x01
  1322. BARTFlagsUrl uint8 = 0x02
  1323. BARTFlagsData uint8 = 0x04
  1324. BARTFlagsUnknown uint8 = 0x40
  1325. BARTFlagsRedirect uint8 = 0x80
  1326. BARTFlagsBanned uint8 = 0xC0
  1327. )
  1328. const (
  1329. BARTReplyCodesSuccess uint8 = 0x00
  1330. BARTReplyCodesInvalid uint8 = 0x01
  1331. BARTReplyCodesNoCustom uint8 = 0x02
  1332. BARTReplyCodesTooSmall uint8 = 0x03
  1333. BARTReplyCodesTooBig uint8 = 0x04
  1334. BARTReplyCodesInvalidType uint8 = 0x05
  1335. BARTReplyCodesBanned uint8 = 0x06
  1336. BARTReplyCodesNotfound uint8 = 0x07
  1337. )
  1338. // GetClearIconHash returns an opaque value set in BARTID hash that indicates
  1339. // the user wants to clear their buddy icon.
  1340. func GetClearIconHash() []byte {
  1341. return []byte{0x02, 0x01, 0xd2, 0x04, 0x72}
  1342. }
  1343. // BARTInfo represents a BART feedbag item
  1344. type BARTInfo struct {
  1345. Flags uint8
  1346. Hash []byte `oscar:"len_prefix=uint8"`
  1347. }
  1348. // HasClearIconHash reports whether the BART ID hash contains the
  1349. // ClearIconHash sentinel value.
  1350. func (h BARTInfo) HasClearIconHash() bool {
  1351. return bytes.Equal(h.Hash, GetClearIconHash())
  1352. }
  1353. type BARTID struct {
  1354. Type uint16
  1355. BARTInfo
  1356. }
  1357. type BartIDsWName struct {
  1358. ScreenName string `oscar:"len_prefix=uint8"`
  1359. IDs []BARTID `oscar:"len_prefix=uint8"`
  1360. }
  1361. type BartQueryReplyID struct {
  1362. QueryID BARTID
  1363. Code uint8
  1364. ReplyID BARTID
  1365. }
  1366. type SNAC_0x10_0x02_BARTUploadQuery struct {
  1367. Type uint16
  1368. Data []byte `oscar:"len_prefix=uint16"`
  1369. }
  1370. type SNAC_0x10_0x03_BARTUploadReply struct {
  1371. Code uint8
  1372. ID BARTID
  1373. }
  1374. type SNAC_0x10_0x04_BARTDownloadQuery struct {
  1375. ScreenName string `oscar:"len_prefix=uint8"`
  1376. Command uint8
  1377. BARTID
  1378. }
  1379. type SNAC_0x10_0x05_BARTDownloadReply struct {
  1380. ScreenName string `oscar:"len_prefix=uint8"`
  1381. BARTID BARTID
  1382. Data []byte `oscar:"len_prefix=uint16"`
  1383. }
  1384. type SNAC_0x10_0x06_BARTDownload2Query struct {
  1385. ScreenName string `oscar:"len_prefix=uint8"`
  1386. IDs []BARTID `oscar:"count_prefix=uint8"`
  1387. }
  1388. type SNAC_0x10_0x07_BARTDownload2Reply struct {
  1389. ScreenName string `oscar:"len_prefix=uint8"`
  1390. ReplyID BartQueryReplyID
  1391. Data []byte `oscar:"len_prefix=uint16"`
  1392. }
  1393. //
  1394. // 0x13: Feedbag
  1395. //
  1396. const (
  1397. FeedbagClassIdBuddy uint16 = 0x0000
  1398. FeedbagClassIdGroup uint16 = 0x0001
  1399. FeedbagClassIDPermit uint16 = 0x0002
  1400. FeedbagClassIDDeny uint16 = 0x0003
  1401. FeedbagClassIdPdinfo uint16 = 0x0004
  1402. FeedbagClassIdBuddyPrefs uint16 = 0x0005
  1403. FeedbagClassIdNonbuddy uint16 = 0x0006
  1404. FeedbagClassIdTpaProvider uint16 = 0x0007
  1405. FeedbagClassIdTpaSubscription uint16 = 0x0008
  1406. FeedbagClassIdClientPrefs uint16 = 0x0009
  1407. FeedbagClassIdStock uint16 = 0x000A
  1408. FeedbagClassIdWeather uint16 = 0x000B
  1409. FeedbagClassIdWatchList uint16 = 0x000D
  1410. FeedbagClassIdIgnoreList uint16 = 0x000E
  1411. FeedbagClassIdDateTime uint16 = 0x000F
  1412. FeedbagClassIdExternalUser uint16 = 0x0010
  1413. FeedbagClassIdRootCreator uint16 = 0x0011
  1414. FeedbagClassIdFish uint16 = 0x0012
  1415. FeedbagClassIdImportTimestamp uint16 = 0x0013
  1416. FeedbagClassIdBart uint16 = 0x0014
  1417. FeedbagClassIdRbOrder uint16 = 0x0015
  1418. FeedbagClassIdPersonality uint16 = 0x0016
  1419. FeedbagClassIdAlProf uint16 = 0x0017
  1420. FeedbagClassIdAlInfo uint16 = 0x0018
  1421. FeedbagClassIdInteraction uint16 = 0x0019
  1422. FeedbagClassIdVanityInfo uint16 = 0x001D
  1423. FeedbagClassIdFavoriteLocation uint16 = 0x001E
  1424. FeedbagClassIdBartPdinfo uint16 = 0x001F
  1425. FeedbagClassIdCustomEmoticons uint16 = 0x0024
  1426. FeedbagClassIdMaxPredefined uint16 = 0x0024
  1427. FeedbagClassIdXIcqStatusNote uint16 = 0x015C
  1428. FeedbagClassIdMin uint16 = 0x0400
  1429. FeedbagAttributesShared uint16 = 0x0064
  1430. FeedbagAttributesInvited uint16 = 0x0065
  1431. FeedbagAttributesPending uint16 = 0x0066
  1432. FeedbagAttributesTimeT uint16 = 0x0067
  1433. FeedbagAttributesDenied uint16 = 0x0068
  1434. FeedbagAttributesSwimIndex uint16 = 0x0069
  1435. FeedbagAttributesRecentBuddy uint16 = 0x006A
  1436. FeedbagAttributesAutoBot uint16 = 0x006B
  1437. FeedbagAttributesInteraction uint16 = 0x006D
  1438. FeedbagAttributesMegaBot uint16 = 0x006F
  1439. FeedbagAttributesOrder uint16 = 0x00C8
  1440. FeedbagAttributesBuddyPrefs uint16 = 0x00C9
  1441. FeedbagAttributesPdMode uint16 = 0x00CA
  1442. FeedbagAttributesPdMask uint16 = 0x00CB
  1443. FeedbagAttributesPdFlags uint16 = 0x00CC
  1444. FeedbagAttributesClientPrefs uint16 = 0x00CD
  1445. FeedbagAttributesLanguage uint16 = 0x00CE
  1446. FeedbagAttributesFishUri uint16 = 0x00CF
  1447. FeedbagAttributesWirelessPdMode uint16 = 0x00D0
  1448. FeedbagAttributesWirelessIgnoreMode uint16 = 0x00D1
  1449. FeedbagAttributesFishPdMode uint16 = 0x00D2
  1450. FeedbagAttributesFishIgnoreMode uint16 = 0x00D3
  1451. FeedbagAttributesCreateTime uint16 = 0x00D4
  1452. FeedbagAttributesBartInfo uint16 = 0x00D5
  1453. FeedbagAttributesBuddyPrefsValid uint16 = 0x00D6
  1454. FeedbagAttributesBuddyPrefs2 uint16 = 0x00D7
  1455. FeedbagAttributesBuddyPrefs2Valid uint16 = 0x00D8
  1456. FeedbagAttributesBartList uint16 = 0x00D9
  1457. FeedbagAttributesArriveSound uint16 = 0x012C
  1458. FeedbagAttributesLeaveSound uint16 = 0x012D
  1459. FeedbagAttributesImage uint16 = 0x012E
  1460. FeedbagAttributesColorBg uint16 = 0x012F
  1461. FeedbagAttributesColorFg uint16 = 0x0130
  1462. FeedbagAttributesAlias uint16 = 0x0131
  1463. FeedbagAttributesPassword uint16 = 0x0132
  1464. FeedbagAttributesDisabled uint16 = 0x0133
  1465. FeedbagAttributesCollapsed uint16 = 0x0134
  1466. FeedbagAttributesUrl uint16 = 0x0135
  1467. FeedbagAttributesActiveList uint16 = 0x0136
  1468. FeedbagAttributesEmailAddr uint16 = 0x0137
  1469. FeedbagAttributesPhoneNumber uint16 = 0x0138
  1470. FeedbagAttributesCellPhoneNumber uint16 = 0x0139
  1471. FeedbagAttributesSmsPhoneNumber uint16 = 0x013A
  1472. FeedbagAttributesWireless uint16 = 0x013B
  1473. FeedbagAttributesNote uint16 = 0x013C
  1474. FeedbagAttributesAlertPrefs uint16 = 0x013D
  1475. FeedbagAttributesBudalertSound uint16 = 0x013E
  1476. FeedbagAttributesStockalertValue uint16 = 0x013F
  1477. FeedbagAttributesTpalertEditUrl uint16 = 0x0140
  1478. FeedbagAttributesTpalertDeleteUrl uint16 = 0x0141
  1479. FeedbagAttributesTpprovMorealertsUrl uint16 = 0x0142
  1480. FeedbagAttributesFish uint16 = 0x0143
  1481. FeedbagAttributesXunconfirmedxLastAccess uint16 = 0x0145
  1482. FeedbagAttributesImSent uint16 = 0x0150
  1483. FeedbagAttributesOnlineTime uint16 = 0x0151
  1484. FeedbagAttributesAwayMsg uint16 = 0x0152
  1485. FeedbagAttributesImReceived uint16 = 0x0153
  1486. FeedbagAttributesBuddyfeedView uint16 = 0x0154
  1487. FeedbagAttributesWorkPhoneNumber uint16 = 0x0158
  1488. FeedbagAttributesOtherPhoneNumber uint16 = 0x0159
  1489. FeedbagAttributesWebPdMode uint16 = 0x015F
  1490. FeedbagAttributesFirstCreationTimeXc uint16 = 0x0167
  1491. FeedbagAttributesPdModeXc uint16 = 0x016E
  1492. FeedbagBuddyPrefsWantsTypingEvents uint32 = 0x400000 // user wants to send and receive typing events
  1493. FeedbagBuddyPrefsAcceptOfflineIM uint16 = 0x34 // user wants to send and receive typing events
  1494. FeedbagRightsMaxClassAttrs uint16 = 0x02
  1495. FeedbagRightsMaxItemAttrs uint16 = 0x03
  1496. FeedbagRightsMaxItemsByClass uint16 = 0x04
  1497. FeedbagRightsMaxClientItems uint16 = 0x05
  1498. FeedbagRightsMaxItemNameLen uint16 = 0x06
  1499. FeedbagRightsMaxRecentBuddies uint16 = 0x07
  1500. FeedbagRightsInteractionBuddies uint16 = 0x08
  1501. FeedbagRightsInteractionHalfLife uint16 = 0x09
  1502. FeedbagRightsInteractionMaxScore uint16 = 0x0A
  1503. FeedbagRightsMaxUnknown0b uint16 = 0x0B
  1504. FeedbagRightsMaxBuddiesPerGroup uint16 = 0x0C
  1505. FeedbagRightsMaxMegaBots uint16 = 0x0D
  1506. FeedbagRightsMaxSmartGroups uint16 = 0x0E
  1507. FeedbagErr uint16 = 0x0001
  1508. FeedbagRightsQuery uint16 = 0x0002
  1509. FeedbagRightsReply uint16 = 0x0003
  1510. FeedbagQuery uint16 = 0x0004
  1511. FeedbagQueryIfModified uint16 = 0x0005
  1512. FeedbagReply uint16 = 0x0006
  1513. FeedbagUse uint16 = 0x0007
  1514. FeedbagInsertItem uint16 = 0x0008
  1515. FeedbagUpdateItem uint16 = 0x0009
  1516. FeedbagDeleteItem uint16 = 0x000A
  1517. FeedbagInsertClass uint16 = 0x000B
  1518. FeedbagUpdateClass uint16 = 0x000C
  1519. FeedbagDeleteClass uint16 = 0x000D
  1520. FeedbagStatus uint16 = 0x000E
  1521. FeedbagReplyNotModified uint16 = 0x000F
  1522. FeedbagDeleteUser uint16 = 0x0010
  1523. FeedbagStartCluster uint16 = 0x0011
  1524. FeedbagEndCluster uint16 = 0x0012
  1525. FeedbagAuthorizeBuddy uint16 = 0x0013
  1526. FeedbagPreAuthorizeBuddy uint16 = 0x0014
  1527. FeedbagPreAuthorizedBuddy uint16 = 0x0015
  1528. FeedbagRemoveMe uint16 = 0x0016
  1529. FeedbagRemoveMe2 uint16 = 0x0017
  1530. FeedbagRequestAuthorizeToHost uint16 = 0x0018
  1531. FeedbagRequestAuthorizeToClient uint16 = 0x0019
  1532. FeedbagRespondAuthorizeToHost uint16 = 0x001A
  1533. FeedbagRespondAuthorizeToClient uint16 = 0x001B
  1534. FeedbagBuddyAdded uint16 = 0x001C
  1535. FeedbagRequestAuthorizeToBadog uint16 = 0x001D
  1536. FeedbagRespondAuthorizeToBadog uint16 = 0x001E
  1537. FeedbagBuddyAddedToBadog uint16 = 0x001F
  1538. FeedbagTestSnac uint16 = 0x0021
  1539. FeedbagForwardMsg uint16 = 0x0022
  1540. FeedbagIsAuthRequiredQuery uint16 = 0x0023
  1541. FeedbagIsAuthRequiredReply uint16 = 0x0024
  1542. FeedbagRecentBuddyUpdate uint16 = 0x0025
  1543. )
  1544. // FeedbagPDMode represents a buddy list permit/deny mode setting that
  1545. // determines who can interact with a user.
  1546. type FeedbagPDMode uint8
  1547. const (
  1548. // FeedbagPDModePermitAll allows all users to see and talk to user. This is
  1549. // the session default.
  1550. FeedbagPDModePermitAll FeedbagPDMode = 0x01
  1551. // FeedbagPDModeDenyAll blocks all users from communicating with user.
  1552. FeedbagPDModeDenyAll FeedbagPDMode = 0x02
  1553. // FeedbagPDModePermitSome only allows a specified list of users to see and
  1554. // talk to user and blocks all others from communicating.
  1555. FeedbagPDModePermitSome FeedbagPDMode = 0x03
  1556. // FeedbagPDModeDenySome blocks a list of users from seeing and talking to
  1557. // user and allows all others to communicate.
  1558. FeedbagPDModeDenySome FeedbagPDMode = 0x04
  1559. // FeedbagPDModePermitOnList only allows communication with users on buddy
  1560. // list and blocks all others from communicating.
  1561. FeedbagPDModePermitOnList FeedbagPDMode = 0x05
  1562. )
  1563. type SNAC_0x13_0x02_FeedbagRightsQuery struct {
  1564. TLVRestBlock
  1565. }
  1566. type SNAC_0x13_0x03_FeedbagRightsReply struct {
  1567. TLVRestBlock
  1568. }
  1569. type SNAC_0x13_0x05_FeedbagQueryIfModified struct {
  1570. LastUpdate uint32
  1571. Count uint8
  1572. }
  1573. type SNAC_0x13_0x06_FeedbagReply struct {
  1574. Version uint8
  1575. Items []FeedbagItem `oscar:"count_prefix=uint16"`
  1576. LastUpdate uint32
  1577. }
  1578. type SNAC_0x13_0x08_FeedbagInsertItem struct {
  1579. Items []FeedbagItem
  1580. }
  1581. type SNAC_0x13_0x09_FeedbagUpdateItem struct {
  1582. Items []FeedbagItem
  1583. }
  1584. type SNAC_0x13_0x0A_FeedbagDeleteItem struct {
  1585. Items []FeedbagItem
  1586. }
  1587. type SNAC_0x13_0x0E_FeedbagStatus struct {
  1588. Results []uint16
  1589. }
  1590. type SNAC_0x13_0x11_FeedbagStartCluster struct {
  1591. TLVRestBlock
  1592. }
  1593. type SNAC_0x13_0x12_FeedbagEndCluster struct {
  1594. }
  1595. type SNAC_0x13_0x18_FeedbagRequestAuthorizationToHost struct {
  1596. ScreenName string `oscar:"len_prefix=uint8"`
  1597. Reason string `oscar:"len_prefix=uint16"`
  1598. Unknown uint16
  1599. }
  1600. type SNAC_0x13_0x1A_FeedbagRespondAuthorizeToHost struct {
  1601. ScreenName string `oscar:"len_prefix=uint8"`
  1602. Accepted uint8
  1603. Reason string `oscar:"len_prefix=uint16"`
  1604. }
  1605. type SNAC_0x13_0x1B_FeedbagRespondAuthorizeToClient struct {
  1606. ScreenName string `oscar:"len_prefix=uint8"`
  1607. Accepted uint8
  1608. Reason string `oscar:"len_prefix=uint16"`
  1609. }
  1610. //
  1611. // 0x15: ICQ
  1612. //
  1613. const (
  1614. ICQErr uint16 = 0x0001
  1615. ICQDBQuery uint16 = 0x0002
  1616. ICQDBReply uint16 = 0x0003
  1617. ICQTLVTagsMetadata uint16 = 0x0001
  1618. ICQTLVTagsUIN uint16 = 0x0136 // User UIN (search)
  1619. ICQTLVTagsFirstName uint16 = 0x0140 // User first name
  1620. ICQTLVTagsLastName uint16 = 0x014A // User last name
  1621. ICQTLVTagsNickname uint16 = 0x0154 // User nickname
  1622. ICQTLVTagsEmail uint16 = 0x015E // User email
  1623. ICQTLVTagsAgeRangeSearch uint16 = 0x0168 // Age range to search (search)
  1624. ICQTLVTagsAge uint16 = 0x0172 // User age
  1625. ICQTLVTagsGender uint16 = 0x017C // User gender
  1626. ICQTLVTagsSpokenLanguage uint16 = 0x0186 // User spoken language
  1627. ICQTLVTagsHomeCityName uint16 = 0x0190 // User home city name
  1628. ICQTLVTagsHomeStateAbbr uint16 = 0x019A // User home state abbreviation
  1629. ICQTLVTagsHomeCountryCode uint16 = 0x01A4 // User home country code
  1630. ICQTLVTagsWorkCompanyName uint16 = 0x01AE // User work company name
  1631. ICQTLVTagsWorkDepartmentName uint16 = 0x01B8 // User work department name
  1632. ICQTLVTagsWorkPositionTitle uint16 = 0x01C2 // User work position (title)
  1633. ICQTLVTagsWorkOccupationCode uint16 = 0x01CC // User work occupation code
  1634. ICQTLVTagsAffiliationsNode uint16 = 0x01D6 // User affiliations node
  1635. ICQTLVTagsInterestsNode uint16 = 0x01EA // User interests node
  1636. ICQTLVTagsPastInfoNode uint16 = 0x01FE // User past info node
  1637. ICQTLVTagsHomepageCategoryKeywords uint16 = 0x0212 // User homepage category/keywords
  1638. ICQTLVTagsHomepageURL uint16 = 0x0213 // User homepage URL
  1639. ICQTLVTagsWhitepagesSearchKeywords uint16 = 0x0226 // Whitepages search keywords string (search)
  1640. ICQTLVTagsSearchOnlineUsersFlag uint16 = 0x0230 // Search only online users flag (search)
  1641. ICQTLVTagsBirthdayInfo uint16 = 0x023A // User birthday info (year, month, day)
  1642. ICQTLVTagsNotesText uint16 = 0x0258 // User notes (about) text
  1643. ICQTLVTagsHomeStreetAddress uint16 = 0x0262 // User home street address
  1644. ICQTLVTagsHomeZipCode uint16 = 0x026C // User home zip code
  1645. ICQTLVTagsHomePhoneNumber uint16 = 0x0276 // User home phone number
  1646. ICQTLVTagsHomeFaxNumber uint16 = 0x0280 // User home fax number
  1647. ICQTLVTagsHomeCellularPhoneNumber uint16 = 0x028A // User home cellular phone number
  1648. ICQTLVTagsWorkStreetAddress uint16 = 0x0294 // User work street address
  1649. ICQTLVTagsWorkCityName uint16 = 0x029E // User work city name
  1650. ICQTLVTagsWorkStateName uint16 = 0x02A8 // User work state name
  1651. ICQTLVTagsWorkCountryCode uint16 = 0x02B2 // User work country code
  1652. ICQTLVTagsWorkZipCode uint16 = 0x02BC // User work zip code
  1653. ICQTLVTagsWorkPhoneNumber uint16 = 0x02C6 // User work phone number
  1654. ICQTLVTagsWorkFaxNumber uint16 = 0x02D0 // User work fax number
  1655. ICQTLVTagsWorkWebpageURL uint16 = 0x02DA // User work webpage URL
  1656. ICQTLVTagsShowWebStatusPermissions uint16 = 0x02F8 // User 'show web status' permissions
  1657. ICQTLVTagsAuthorizationPermissions uint16 = 0x030C // User authorization permissions
  1658. ICQTLVTagsGMTOffset uint16 = 0x0316 // User GMT offset
  1659. ICQTLVTagsOriginallyFromCity uint16 = 0x0320 // User originally from city
  1660. ICQTLVTagsOriginallyFromState uint16 = 0x032A // User originally from state
  1661. ICQTLVTagsOriginallyFromCountryCode uint16 = 0x0334 // User originally from country (code)
  1662. ICQDirTLVTagsPrivacyToken uint16 = 0x003C // Privacy token (16 bytes)
  1663. ICQDirTLVTagsVerifiedEmail uint16 = 0x0050 // Verified email address
  1664. ICQDirTLVTagsPendingEmail uint16 = 0x0055 // Pending email address
  1665. ICQDirTLVTagsFirstName uint16 = 0x0064 // First name
  1666. ICQDirTLVTagsLastName uint16 = 0x006E // Last name
  1667. ICQDirTLVTagsNickname uint16 = 0x0078 // Nickname
  1668. ICQDirTLVTagsGender uint16 = 0x0082 // Gender (1=Female, 2=Male)
  1669. ICQDirTLVTagsEmailAddresses uint16 = 0x008C // Email addresses (record list)
  1670. ICQDirTLVTagsHomeAddress uint16 = 0x0096 // Home address
  1671. ICQDirTLVTagsOriginAddress uint16 = 0x00A0 // Origin/birth address
  1672. ICQDirTLVTagsLanguage1 uint16 = 0x00AA // Primary language
  1673. ICQDirTLVTagsLanguage2 uint16 = 0x00B4 // Secondary language
  1674. ICQDirTLVTagsLanguage3 uint16 = 0x00BE // Tertiary language
  1675. ICQDirTLVTagsPhoneNumbers uint16 = 0x00C8 // Phone numbers (record list)
  1676. ICQDirTLVTagsHomepage uint16 = 0x00FA // Homepage URL
  1677. ICQDirTLVTagsEducation uint16 = 0x010E // Education info
  1678. ICQDirTLVTagsCompanyInfo uint16 = 0x0118 // Company/work info
  1679. ICQDirTLVTagsInterests uint16 = 0x0122 // Interests
  1680. ICQDirTLVTagsMaritalStatus uint16 = 0x012C // Marital status
  1681. ICQDirTLVTagsTimezone uint16 = 0x017C // Timezone
  1682. ICQDirTLVTagsAboutBio uint16 = 0x0186 // About/biography text
  1683. ICQDirTLVTagsAuthRequired uint16 = 0x019A // Authorization required flag
  1684. ICQDirTLVTagsBirthDate uint16 = 0x01A4 // Birth date
  1685. ICQDirTLVTagsCodePage uint16 = 0x01C2 // Code page
  1686. ICQDirTLVTagsMetadataTime uint16 = 0x01CC // Metadata update time
  1687. ICQDirTLVTagsAllowSpam uint16 = 0x01EA // Allow spam/messages from non-contacts flag
  1688. ICQDirTLVTagsPrivacyLevel uint16 = 0x01F9 // Privacy level
  1689. ICQDirTLVTagsWebAware uint16 = 0x0212 // Web aware flag (online visibility via web)
  1690. ICQDirTLVTagsStatusNote uint16 = 0x0226 // Status note/message
  1691. ICQStatusCodeOK uint8 = 0x0A
  1692. ICQStatusCodeFail uint8 = 0x32
  1693. ICQStatusCodeErr uint8 = 0x14
  1694. ICQDBQueryOfflineMsgReq uint16 = 0x003C
  1695. ICQDBQueryOfflineMsgReply uint16 = 0x0041
  1696. ICQDBQueryOfflineMsgReplyLast uint16 = 0x0042
  1697. ICQDBQueryDeleteMsgReq uint16 = 0x003E
  1698. ICQDBQueryMetaReq uint16 = 0x07D0
  1699. ICQDBQueryMetaReply uint16 = 0x07DA
  1700. )
  1701. const (
  1702. ICQUserFlagPublishEmailYes uint8 = 0
  1703. ICQUserFlagPublishEmailNo uint8 = 1
  1704. )
  1705. const (
  1706. ICQDBQueryMetaReqSetBasicInfo uint16 = 0x03EA
  1707. ICQDBQueryMetaReqSetWorkInfo uint16 = 0x03F3
  1708. ICQDBQueryMetaReqSetMoreInfo uint16 = 0x03FD
  1709. ICQDBQueryMetaReqSetNotes uint16 = 0x0406
  1710. ICQDBQueryMetaReqSetEmails uint16 = 0x040B
  1711. ICQDBQueryMetaReqSetInterests uint16 = 0x0410
  1712. ICQDBQueryMetaReqSetAffiliations uint16 = 0x041A
  1713. ICQDBQueryMetaReqSetPermissions uint16 = 0x0424
  1714. ICQDBQueryMetaReqSetICQPhone uint16 = 0x0654
  1715. ICQDBQueryMetaReqShortInfo uint16 = 0x04BA
  1716. ICQDBQueryMetaReqFullInfo uint16 = 0x04B2
  1717. ICQDBQueryMetaReqFullInfo2 uint16 = 0x04D0
  1718. ICQDBQueryMetaReqSearchByDetails uint16 = 0x0515
  1719. ICQDBQueryMetaReqSearchByUIN uint16 = 0x051F
  1720. ICQDBQueryMetaReqSearchByEmail uint16 = 0x0529
  1721. ICQDBQueryMetaReqSearchWhitePages uint16 = 0x0533
  1722. ICQDBQueryMetaReqSearchWhitePages2 uint16 = 0x055F
  1723. ICQDBQueryMetaReqSearchByUIN2 uint16 = 0x0569
  1724. ICQDBQueryMetaReqSearchByEmail3 uint16 = 0x0573
  1725. ICQDBQueryMetaReqStat0758 uint16 = 0x0758
  1726. ICQDBQueryMetaReqXMLReq uint16 = 0x0898
  1727. ICQDBQueryMetaReqStat0a8c uint16 = 0x0A8C
  1728. ICQDBQueryMetaReqStat0a96 uint16 = 0x0A96
  1729. ICQDBQueryMetaReqStat0aaa uint16 = 0x0AAA
  1730. ICQDBQueryMetaReqStat0ab4 uint16 = 0x0AB4
  1731. ICQDBQueryMetaReqStat0ab9 uint16 = 0x0AB9
  1732. ICQDBQueryMetaReqStat0abe uint16 = 0x0ABE
  1733. ICQDBQueryMetaReqStat0ac8 uint16 = 0x0AC8
  1734. ICQDBQueryMetaReqStat0acd uint16 = 0x0ACD
  1735. ICQDBQueryMetaReqStat0ad2 uint16 = 0x0AD2
  1736. ICQDBQueryMetaReqStat0ad7 uint16 = 0x0AD7
  1737. ICQDBQueryMetaReqDirectoryQuery uint16 = 0x0FA0
  1738. ICQDBQueryMetaReqDirectoryUpdate uint16 = 0x0FD2
  1739. ICQDBQueryMetaReplySetBasicInfo uint16 = 0x0064
  1740. ICQDBQueryMetaReplySetWorkInfo uint16 = 0x006E
  1741. ICQDBQueryMetaReplySetMoreInfo uint16 = 0x0078
  1742. ICQDBQueryMetaReplySetNotes uint16 = 0x0082
  1743. ICQDBQueryMetaReplySetEmails uint16 = 0x0087
  1744. ICQDBQueryMetaReplySetInterests uint16 = 0x008C
  1745. ICQDBQueryMetaReplySetAffiliations uint16 = 0x0096
  1746. ICQDBQueryMetaReplySetPermissions uint16 = 0x00A0
  1747. ICQDBQueryMetaReplySetICQPhone uint16 = 0x031E
  1748. ICQDBQueryMetaReplyBasicInfo uint16 = 0x00C8
  1749. ICQDBQueryMetaReplyWorkInfo uint16 = 0x00D2
  1750. ICQDBQueryMetaReplyMoreInfo uint16 = 0x00DC
  1751. ICQDBQueryMetaReplyNotes uint16 = 0x00E6
  1752. ICQDBQueryMetaReplyExtEmailInfo uint16 = 0x00EB
  1753. ICQDBQueryMetaReplyInterests uint16 = 0x00F0
  1754. ICQDBQueryMetaReplyAffiliations uint16 = 0x00FA
  1755. ICQDBQueryMetaReplyShortInfo uint16 = 0x0104
  1756. ICQDBQueryMetaReplyHomePageCat uint16 = 0x010E
  1757. ICQDBQueryMetaReplyUserFound uint16 = 0x01A4
  1758. ICQDBQueryMetaReplyLastUserFound uint16 = 0x01AE
  1759. ICQDBQueryMetaReplyXMLData uint16 = 0x08A2
  1760. )
  1761. type SNAC_0x15_0x02_BQuery struct {
  1762. TLVRestBlock
  1763. }
  1764. type ICQ_0x07D0_0x04BA_DBQueryMetaReqShortInfo struct {
  1765. UIN uint32
  1766. }
  1767. type ICQ_0x07D0_0x0898_DBQueryMetaReqXMLReq struct {
  1768. XMLRequest string `oscar:"len_prefix=uint16,nullterm"`
  1769. }
  1770. type ICQ_0x07D0_0x0424_DBQueryMetaReqSetPermissions struct {
  1771. Authorization uint8 // (1-required, 0-not required)
  1772. WebAware uint8 // webaware (0-no, 1-yes)
  1773. DCPerms uint8 // dc_perms (0-any, 1-contact, 2-authorization)
  1774. Unknown uint8
  1775. }
  1776. // ICQ_0x07D0_0x0654_DBQueryMetaReqSetICQPhone represents a request to set
  1777. // ICQPhone information.
  1778. type ICQ_0x07D0_0x0654_DBQueryMetaReqSetICQPhone struct {
  1779. // acknowledge the data, do nothing
  1780. }
  1781. type ICQ_0x07D0_0x051F_DBQueryMetaReqSearchByUIN struct {
  1782. UIN uint32
  1783. }
  1784. type ICQ_0x07D0_0x0569_DBQueryMetaReqSearchByUIN2 struct {
  1785. TLVRestBlock
  1786. }
  1787. type ICQ_0x07D0_0x0529_DBQueryMetaReqSearchByEmail struct {
  1788. Email string `oscar:"len_prefix=uint16,nullterm"`
  1789. }
  1790. type ICQ_0x07D0_0x0573_DBQueryMetaReqSearchByEmail3 struct {
  1791. TLVRestBlock
  1792. }
  1793. type ICQ_0x07D0_0x0515_DBQueryMetaReqSearchByDetails struct {
  1794. FirstName string `oscar:"len_prefix=uint16,nullterm"`
  1795. LastName string `oscar:"len_prefix=uint16,nullterm"`
  1796. NickName string `oscar:"len_prefix=uint16,nullterm"`
  1797. }
  1798. type ICQInterests struct {
  1799. Code uint16
  1800. Keyword string `oscar:"len_prefix=uint16,nullterm"`
  1801. }
  1802. type ICQEmail struct {
  1803. Email string `oscar:"len_prefix=uint16,nullterm"`
  1804. }
  1805. type ICQ_0x07D0_0x0533_DBQueryMetaReqSearchWhitePages struct {
  1806. FirstName string `oscar:"len_prefix=uint16,nullterm"`
  1807. LastName string `oscar:"len_prefix=uint16,nullterm"`
  1808. Nickname string `oscar:"len_prefix=uint16,nullterm"`
  1809. Email string `oscar:"len_prefix=uint16,nullterm"`
  1810. MinAge uint16
  1811. MaxAge uint16
  1812. Gender uint8
  1813. SpeakingLang uint8
  1814. City string `oscar:"len_prefix=uint16,nullterm"`
  1815. State string `oscar:"len_prefix=uint16,nullterm"`
  1816. CountryCode uint16
  1817. Company string `oscar:"len_prefix=uint16,nullterm"`
  1818. Department string `oscar:"len_prefix=uint16,nullterm"`
  1819. Position string `oscar:"len_prefix=uint16,nullterm"`
  1820. OccupationCode uint16
  1821. PastCode uint16
  1822. PastKeywords string `oscar:"len_prefix=uint16,nullterm"`
  1823. InterestsCode uint16
  1824. InterestsKeyword string `oscar:"len_prefix=uint16,nullterm"`
  1825. AffiliationsCode uint16
  1826. AffiliationsKeyword string `oscar:"len_prefix=uint16,nullterm"`
  1827. HomePageCode uint16
  1828. HomePageKeywords string `oscar:"len_prefix=uint16,nullterm"`
  1829. SearchScope uint8
  1830. }
  1831. type ICQ_0x07D0_0x055F_DBQueryMetaReqSearchWhitePages2 struct {
  1832. TLVRestBlock
  1833. }
  1834. type ICQ_0x07D0_0x03FD_DBQueryMetaReqSetMoreInfo struct {
  1835. Age uint8 // not used because age is calculated from birthdate
  1836. Gender uint16
  1837. HomePageAddr string `oscar:"len_prefix=uint16,nullterm"`
  1838. BirthYear uint16
  1839. BirthMonth uint8
  1840. BirthDay uint8
  1841. Lang1 uint8
  1842. Lang2 uint8
  1843. Lang3 uint8
  1844. }
  1845. type ICQ_0x07D0_0x03F3_DBQueryMetaReqSetWorkInfo struct {
  1846. City string `oscar:"len_prefix=uint16,nullterm"`
  1847. State string `oscar:"len_prefix=uint16,nullterm"`
  1848. Phone string `oscar:"len_prefix=uint16,nullterm"`
  1849. Fax string `oscar:"len_prefix=uint16,nullterm"`
  1850. Address string `oscar:"len_prefix=uint16,nullterm"`
  1851. ZIP string `oscar:"len_prefix=uint16,nullterm"`
  1852. CountryCode uint16
  1853. Company string `oscar:"len_prefix=uint16,nullterm"`
  1854. Department string `oscar:"len_prefix=uint16,nullterm"`
  1855. Position string `oscar:"len_prefix=uint16,nullterm"`
  1856. OccupationCode uint16
  1857. WebPage string `oscar:"len_prefix=uint16,nullterm"`
  1858. }
  1859. type ICQ_0x07D0_0x040B_DBQueryMetaReqSetEmails struct {
  1860. Emails []struct {
  1861. Publish uint8
  1862. Email string `oscar:"len_prefix=uint16,nullterm"`
  1863. } `oscar:"count_prefix=uint8"`
  1864. }
  1865. type ICQ_0x07D0_0x0406_DBQueryMetaReqSetNotes struct {
  1866. Notes string `oscar:"len_prefix=uint16,nullterm"`
  1867. }
  1868. type ICQ_0x07D0_0x0410_DBQueryMetaReqSetInterests struct {
  1869. Interests []struct {
  1870. Code uint16
  1871. Keyword string `oscar:"len_prefix=uint16,nullterm"`
  1872. } `oscar:"count_prefix=uint8"`
  1873. }
  1874. type ICQ_0x07D0_0x041A_DBQueryMetaReqSetAffiliations struct {
  1875. PastAffiliations []struct {
  1876. Code uint16
  1877. Keyword string `oscar:"len_prefix=uint16,nullterm"`
  1878. } `oscar:"count_prefix=uint8"`
  1879. Affiliations []struct {
  1880. Code uint16
  1881. Keyword string `oscar:"len_prefix=uint16,nullterm"`
  1882. } `oscar:"count_prefix=uint8"`
  1883. }
  1884. type ICQ_0x07D0_0x03EA_DBQueryMetaReqSetBasicInfo struct {
  1885. Nickname string `oscar:"len_prefix=uint16,nullterm"`
  1886. FirstName string `oscar:"len_prefix=uint16,nullterm"`
  1887. LastName string `oscar:"len_prefix=uint16,nullterm"`
  1888. EmailAddress string `oscar:"len_prefix=uint16,nullterm"`
  1889. City string `oscar:"len_prefix=uint16,nullterm"`
  1890. State string `oscar:"len_prefix=uint16,nullterm"`
  1891. Phone string `oscar:"len_prefix=uint16,nullterm"`
  1892. Fax string `oscar:"len_prefix=uint16,nullterm"`
  1893. HomeAddress string `oscar:"len_prefix=uint16,nullterm"`
  1894. CellPhone string `oscar:"len_prefix=uint16,nullterm"`
  1895. ZIP string `oscar:"len_prefix=uint16,nullterm"`
  1896. CountryCode uint16
  1897. GMTOffset uint8
  1898. PublishEmail uint8
  1899. }
  1900. type SNAC_0x15_0x02_DBReply struct {
  1901. TLVRestBlock
  1902. }
  1903. type ICQ_0x07DA_0x010E_DBQueryMetaReplyHomePageCat struct {
  1904. ICQMetadata
  1905. ReqSubType uint16
  1906. Success uint8
  1907. Enabled uint8
  1908. CatCode uint16
  1909. Keywords string `oscar:"len_prefix=uint16,nullterm"`
  1910. Unknown uint8
  1911. }
  1912. type ICQ_0x07DA_0x08A2_DBQueryMetaReplyXMLData struct {
  1913. ICQMetadata
  1914. ReqSubType uint16
  1915. Success uint8
  1916. XML string `oscar:"len_prefix=uint16,nullterm"`
  1917. }
  1918. type ICQ_0x07DA_0x00DC_DBQueryMetaReplyMoreInfo struct {
  1919. ICQMetadata
  1920. ReqSubType uint16
  1921. Success uint8
  1922. ICQ_0x07D0_0x03FD_DBQueryMetaReqSetMoreInfo
  1923. Unknown uint16
  1924. City string `oscar:"len_prefix=uint16,nullterm"`
  1925. State string `oscar:"len_prefix=uint16,nullterm"`
  1926. CountryCode uint16
  1927. TimeZone uint8
  1928. }
  1929. type ICQ_0x07DA_0x00EB_DBQueryMetaReplyExtEmailInfo struct {
  1930. ICQMetadata
  1931. ReqSubType uint16
  1932. Success uint8
  1933. Emails []struct {
  1934. Flag uint8 // (0-publish, 1-don't)
  1935. Email string `oscar:"len_prefix=uint16,nullterm"`
  1936. } `oscar:"count_prefix=uint8"`
  1937. }
  1938. type ICQ_0x07DA_0x00D2_DBQueryMetaReplyWorkInfo struct {
  1939. ICQMetadata
  1940. ReqSubType uint16
  1941. Success uint8
  1942. ICQ_0x07D0_0x03F3_DBQueryMetaReqSetWorkInfo
  1943. }
  1944. type ICQ_0x07DA_0x00F0_DBQueryMetaReplyInterests struct {
  1945. ICQMetadata
  1946. ReqSubType uint16
  1947. Success uint8
  1948. Interests []struct {
  1949. Code uint16
  1950. Keyword string `oscar:"len_prefix=uint16,nullterm"`
  1951. } `oscar:"count_prefix=uint8"`
  1952. }
  1953. type ICQ_0x07DA_0x00E6_DBQueryMetaReplyNotes struct {
  1954. ICQMetadata
  1955. ReqSubType uint16
  1956. Success uint8
  1957. ICQ_0x07D0_0x0406_DBQueryMetaReqSetNotes
  1958. }
  1959. type ICQ_0x07DA_0x00FA_DBQueryMetaReplyAffiliations struct {
  1960. ICQMetadata
  1961. ReqSubType uint16
  1962. Success uint8
  1963. ICQ_0x07D0_0x041A_DBQueryMetaReqSetAffiliations
  1964. }
  1965. type ICQ_0x07DA_0x00C8_DBQueryMetaReplyBasicInfo struct {
  1966. ICQMetadata
  1967. ReqSubType uint16
  1968. Success uint8
  1969. Nickname string `oscar:"len_prefix=uint16,nullterm"`
  1970. FirstName string `oscar:"len_prefix=uint16,nullterm"`
  1971. LastName string `oscar:"len_prefix=uint16,nullterm"`
  1972. Email string `oscar:"len_prefix=uint16,nullterm"`
  1973. City string `oscar:"len_prefix=uint16,nullterm"`
  1974. State string `oscar:"len_prefix=uint16,nullterm"`
  1975. Phone string `oscar:"len_prefix=uint16,nullterm"`
  1976. Fax string `oscar:"len_prefix=uint16,nullterm"`
  1977. Address string `oscar:"len_prefix=uint16,nullterm"`
  1978. CellPhone string `oscar:"len_prefix=uint16,nullterm"`
  1979. ZIP string `oscar:"len_prefix=uint16,nullterm"`
  1980. CountryCode uint16
  1981. GMTOffset uint8
  1982. AuthFlag uint8
  1983. WebAware uint8
  1984. DCPerms uint8
  1985. PublishEmail uint8
  1986. }
  1987. type ICQ_0x07DA_0x01AE_DBQueryMetaReplyLastUserFound struct {
  1988. ICQMetadata
  1989. ReqSubType uint16
  1990. Success uint8
  1991. Details ICQUserSearchRecord `oscar:"len_prefix=uint16"`
  1992. // LastMessageFooter is set only on the last message in the batch
  1993. LastMessageFooter *struct {
  1994. FoundUsersLeft uint32
  1995. } `oscar:"optional"`
  1996. }
  1997. // LastResult flags the message as the last message in the search results.
  1998. func (s *ICQ_0x07DA_0x01AE_DBQueryMetaReplyLastUserFound) LastResult() {
  1999. s.ReqSubType = ICQDBQueryMetaReplyLastUserFound
  2000. s.LastMessageFooter = &struct {
  2001. FoundUsersLeft uint32
  2002. }{
  2003. FoundUsersLeft: 0,
  2004. }
  2005. }
  2006. type ICQ_0x07DA_0x0104_DBQueryMetaReplyShortInfo struct {
  2007. ICQMetadata
  2008. ReqSubType uint16
  2009. Success uint8
  2010. Nickname string `oscar:"len_prefix=uint16,nullterm"`
  2011. FirstName string `oscar:"len_prefix=uint16,nullterm"`
  2012. LastName string `oscar:"len_prefix=uint16,nullterm"`
  2013. Email string `oscar:"len_prefix=uint16,nullterm"`
  2014. Authorization uint8
  2015. Unknown uint8
  2016. Gender uint8
  2017. }
  2018. type ICQ_0x0041_DBQueryOfflineMsgReply struct {
  2019. ICQMetadata
  2020. SenderUIN uint32
  2021. Year uint16
  2022. Month uint8
  2023. Day uint8
  2024. Hour uint8
  2025. Minute uint8
  2026. MsgType uint8
  2027. Flags uint8
  2028. Message string `oscar:"len_prefix=uint16,nullterm"`
  2029. }
  2030. type ICQ_0x0042_DBQueryOfflineMsgReplyLast struct {
  2031. ICQMetadata
  2032. DroppedMessages uint8
  2033. }
  2034. type ICQMetadataWithSubType struct {
  2035. ICQMetadata
  2036. Optional *struct {
  2037. ReqSubType uint16
  2038. } `oscar:"optional"`
  2039. }
  2040. type ICQMetadata struct {
  2041. UIN uint32
  2042. ReqType uint16
  2043. Seq uint16
  2044. }
  2045. // ICQMessageRequestEnvelope is a helper struct that provides syntactic sugar for
  2046. // unmarshaling an ICQ message into a little-endian byte array.
  2047. type ICQMessageRequestEnvelope struct {
  2048. Body []byte `oscar:"len_prefix=uint16"`
  2049. }
  2050. // ICQMessageReplyEnvelope is a helper struct that provides syntactic sugar for
  2051. // marshaling an ICQ message into a little-endian byte array.
  2052. type ICQMessageReplyEnvelope struct {
  2053. Message any `oscar:"len_prefix=uint16"`
  2054. }
  2055. type ICQUserSearchRecord struct {
  2056. UIN uint32
  2057. Nickname string `oscar:"len_prefix=uint16,nullterm"`
  2058. FirstName string `oscar:"len_prefix=uint16,nullterm"`
  2059. LastName string `oscar:"len_prefix=uint16,nullterm"`
  2060. Email string `oscar:"len_prefix=uint16,nullterm"`
  2061. Authorization uint8
  2062. OnlineStatus uint16
  2063. Gender uint8
  2064. Age uint16
  2065. }
  2066. //
  2067. // 0x17: BUCP
  2068. //
  2069. const (
  2070. BUCPErr uint16 = 0x0001
  2071. BUCPLoginRequest uint16 = 0x0002
  2072. BUCPLoginResponse uint16 = 0x0003
  2073. BUCPRegisterRequest uint16 = 0x0004
  2074. BUCPChallengeRequest uint16 = 0x0006
  2075. BUCPChallengeResponse uint16 = 0x0007
  2076. BUCPAsasnRequest uint16 = 0x0008
  2077. BUCPSecuridRequest uint16 = 0x000A
  2078. BUCPRegistrationImageRequest uint16 = 0x000C
  2079. )
  2080. type SNAC_0x17_0x02_BUCPLoginRequest struct {
  2081. TLVRestBlock
  2082. }
  2083. type SNAC_0x17_0x03_BUCPLoginResponse struct {
  2084. TLVRestBlock
  2085. }
  2086. type SNAC_0x17_0x06_BUCPChallengeRequest struct {
  2087. TLVRestBlock
  2088. }
  2089. type SNAC_0x17_0x07_BUCPChallengeResponse struct {
  2090. AuthKey string `oscar:"len_prefix=uint16"`
  2091. }
  2092. //
  2093. // 0x18: Alert
  2094. //
  2095. const (
  2096. AlertErr uint16 = 0x0001
  2097. AlertSetAlertRequest uint16 = 0x0002
  2098. AlertSetAlertReply uint16 = 0x0003
  2099. AlertGetSubsRequest uint16 = 0x0004
  2100. AlertGetSubsResponse uint16 = 0x0005
  2101. AlertNotifyCapabilities uint16 = 0x0006
  2102. AlertNotify uint16 = 0x0007
  2103. AlertGetRuleRequest uint16 = 0x0008
  2104. AlertGetRuleReply uint16 = 0x0009
  2105. AlertGetFeedRequest uint16 = 0x000A
  2106. AlertGetFeedReply uint16 = 0x000B
  2107. AlertRefreshFeed uint16 = 0x000D
  2108. AlertEvent uint16 = 0x000E
  2109. AlertQogSnac uint16 = 0x000F
  2110. AlertRefreshFeedStock uint16 = 0x0010
  2111. AlertNotifyTransport uint16 = 0x0011
  2112. AlertSetAlertRequestV2 uint16 = 0x0012
  2113. AlertSetAlertReplyV2 uint16 = 0x0013
  2114. AlertTransitReply uint16 = 0x0014
  2115. AlertNotifyAck uint16 = 0x0015
  2116. AlertNotifyDisplayCapabilities uint16 = 0x0016
  2117. AlertUserOnline uint16 = 0x0017
  2118. )
  2119. //
  2120. // Kerberos Auth (AIM 6+)
  2121. //
  2122. const (
  2123. KerberosLoginRequest uint16 = 0x0002
  2124. KerberosLoginSuccessResponse uint16 = 0x0003
  2125. KerberosKerberosLoginErrResponse uint16 = 0x0004
  2126. KerberosTLVTicketRequest uint16 = 0x0002
  2127. KerberosTLVBOSServerInfo uint16 = 0x0003
  2128. KerberosTLVHostname uint16 = 0x0005
  2129. KerberosTLVCookie uint16 = 0x0006
  2130. KerberosTLVConnSettings uint16 = 0x008E
  2131. KerberosConnUseSSL uint16 = 0x0002
  2132. KerberosErrAuthFailure uint16 = 0x0401
  2133. )
  2134. // SNAC_0x050C_0x0002_KerberosLoginRequest represents a Kerberos-like login request
  2135. // sent by the AIM client as part of the OSCAR authentication handshake using SNAC(0x050C, 0x0002).
  2136. type SNAC_0x050C_0x0002_KerberosLoginRequest struct {
  2137. // RequestID is a client-generated identifier that matches the one echoed in the server response.
  2138. RequestID uint32
  2139. // ClientIP is the client's IPv4 address in network byte order.
  2140. ClientIP uint32
  2141. // ClientCOOLVersionMajor is the major version of the AIM client "COOL" protocol.
  2142. ClientCOOLVersionMajor uint32
  2143. // ClientCOOLVersionMinor is the minor version of the AIM client "COOL" protocol.
  2144. ClientCOOLVersionMinor uint32
  2145. // PaddingOrZero is always observed as 0x00000000 and may be reserved/padding.
  2146. PaddingOrZero uint32
  2147. // KerberosPayload contains TLV-encoded data, typically including the AP-REQ (TLV 0x0005).
  2148. KerberosPayload TLVBlock
  2149. // LocaleFlags1 appears to contain locale or encoding hints, possibly bitflags.
  2150. LocaleFlags1 uint32
  2151. // LocaleFlags2 is another locale- or feature-related field, typically zero.
  2152. LocaleFlags2 uint32
  2153. // CountryCode is the user's ISO 3166-1 alpha-2 country code (e.g., "US").
  2154. CountryCode string `oscar:"len_prefix=uint16"`
  2155. // LanguageCode is the user's ISO 639-1 language code (e.g., "en").
  2156. LanguageCode string `oscar:"len_prefix=uint16"`
  2157. // ServiceContextBlock is a TLV block containing client realm and service info.
  2158. ServiceContextBlock TLVBlock
  2159. // VersionOrFlags is likely a protocol feature version or flag mask (exact meaning unknown).
  2160. VersionOrFlags uint32
  2161. // AuthType is a 1-byte value (usually 0x00 or 0x01), possibly denoting password type or encoding.
  2162. AuthType byte
  2163. // ClientPrincipal is the Kerberos principal name (username).
  2164. ClientPrincipal string `oscar:"len_prefix=uint16"`
  2165. // ServicePrincipal is the Kerberos service string (e.g., "im/boss").
  2166. ServicePrincipal string `oscar:"len_prefix=uint16"`
  2167. // Reserved1 is typically zero; possibly a padding or reserved field.
  2168. Reserved1 uint32
  2169. // RealmCount is typically 0x0002; may indicate how many realms or tickets are requested.
  2170. RealmCount uint16
  2171. // TicketRequestMetadata is a TLV block describing requested tickets (e.g., realm, lifetime, enctype).
  2172. TicketRequestMetadata TLVBlock
  2173. }
  2174. // SNAC_0x050C_0x0003_KerberosLoginSuccessResponse represents the server's response to a successful
  2175. // Kerberos-like login request in AIM's OSCAR protocol. It includes the client identity and issued tickets.
  2176. type SNAC_0x050C_0x0003_KerberosLoginSuccessResponse struct {
  2177. // RequestID matches the KerberosRequestID from the original client request (for correlation).
  2178. RequestID uint32
  2179. // Epoch is a server-issued timestamp indicating when the client was authenticated.
  2180. // This is often used as the start time for ticket validity.
  2181. Epoch uint32
  2182. // Reserved is a 4-byte field, usually zero. Possibly reserved for future use or alignment.
  2183. Reserved uint32
  2184. // ClientPrincipal is the Kerberos principal name of the authenticated client.
  2185. ClientPrincipal string `oscar:"len_prefix=uint16"`
  2186. // ClientRealm is the Kerberos realm in which the client was authenticated (e.g., "AOL").
  2187. ClientRealm string `oscar:"len_prefix=uint16"`
  2188. // Tickets contains one or more issued Kerberos tickets, including service tickets and/or a TGT.
  2189. // These are encoded in ASN.1 DER and include session keys, expiration, and encrypted blobs.
  2190. Tickets []KerberosTicket `oscar:"count_prefix=uint16"`
  2191. // Extensions is a TLVBlock containing optional metadata. May include:
  2192. // - Client capabilities
  2193. // - Locales or language tags
  2194. // - Echoed usernames
  2195. // - Additional authentication hints
  2196. Extensions TLVBlock
  2197. }
  2198. // SNAC_0x050C_0x0004_KerberosLoginErrResponse represents a login failure response
  2199. // sent by the AIM server in reply to a Kerberos-style login attempt (SNAC 0x050C/0x0002).
  2200. //
  2201. // This SNAC is typically sent when authentication fails due to an invalid password,
  2202. // unknown screen name, or protocol-level issues. It includes a human-readable message
  2203. // and an error code, along with optional TLV metadata.
  2204. type SNAC_0x050C_0x0004_KerberosLoginErrResponse struct {
  2205. // KerbRequestID matches the KerberosRequestID from the original login request,
  2206. // allowing the client to correlate the response to the appropriate attempt.
  2207. KerbRequestID uint32
  2208. // ScreenName is the screen name the client attempted to authenticate as.
  2209. // This is echoed back by the server for clarity/debugging.
  2210. ScreenName string `oscar:"len_prefix=uint16"`
  2211. // ErrCode is a 2-byte error code indicating the reason for login failure.
  2212. // The only supported value is 0x0401, which indicates an invalid username
  2213. // or password.
  2214. ErrCode uint16
  2215. // Message is a UTF-8 string providing a user-facing explanation of the error
  2216. // (e.g., "Invalid screen name or password").
  2217. Message string `oscar:"len_prefix=uint16"`
  2218. // Unknown1 is an unknown flag.
  2219. Unknown1 uint32
  2220. // Metadata is a TLVBlock that may contain additional metadata about the failure.
  2221. Metadata TLVBlock
  2222. }
  2223. // KerberosLoginRequestTicket appears inside TLV 0x0002 of the
  2224. // Ticket-Request Metadata block that the AIM client bundles into
  2225. // its "Kerberos Login Request" (SNAC 0x050C/0x0002).
  2226. type KerberosLoginRequestTicket struct {
  2227. // Marker might indicate the payload type.
  2228. Marker uint32
  2229. // Version might indicate the internal structure version.
  2230. Version uint16
  2231. // Flags contains unknown flags.
  2232. Flags uint32
  2233. // Unknown is an unknown field.
  2234. Unknown uint16
  2235. // Password holds the user’s password.
  2236. Password []byte `oscar:"len_prefix=uint16"`
  2237. // PasswordMetadata may hold additional metadata about the password.
  2238. PasswordMetadata TLVBlock
  2239. }
  2240. // KerberosTicket represents one service ticket returned inside the
  2241. // SNAC(0x050C, 0x0003) "Kerberos Login Success" response.
  2242. //
  2243. // TicketBlob follows the general layout of an RFC 4120 Ticket,
  2244. // but is delivered in AIM’s TLV wrapper rather than a full KRB-TGS-REP.
  2245. type KerberosTicket struct {
  2246. // PVNO is the Kerberos protocol-version number carried
  2247. // in the ticket header. In Kerberos V5 this is always 0x0005.
  2248. PVNO uint16
  2249. // EncTicket is the raw ASN.1 DER-encoded Ticket structure
  2250. // (encrypted to the service key). Length is given by the preceding
  2251. // uint16 in the OSCAR stream.
  2252. EncTicket []byte `oscar:"len_prefix=uint16"`
  2253. // TicketRealm is the realm to which the service principal belongs
  2254. // (e.g. "AOL").
  2255. TicketRealm string `oscar:"len_prefix=uint16"`
  2256. // ServicePrincipal is the complete service-principal name for which
  2257. // the ticket is valid (e.g. "im/boss").
  2258. ServicePrincipal string `oscar:"len_prefix=uint16"`
  2259. // ClientRealm is the Kerberos realm of the authenticated user.
  2260. ClientRealm string `oscar:"len_prefix=uint16"`
  2261. // ClientPrincipal is the principal name inside that realm.
  2262. ClientPrincipal string `oscar:"len_prefix=uint16"`
  2263. // KVNO (Key Version Number) tells the service which
  2264. // long-term key to use when decrypting EncTicket.
  2265. KVNO uint8
  2266. // SessionKey is the clear-text session key that the KDC also placed,
  2267. // encrypted, inside EncTicket. Provided here for the client’s
  2268. // convenience so it doesn’t have to decrypt the ticket itself.
  2269. SessionKey []byte `oscar:"len_prefix=uint16"`
  2270. // Unknown1 is typically zero. Possibly reserved or unused.
  2271. Unknown1 uint32
  2272. // Unknown2 is a possible bitfield.
  2273. Unknown2 uint32
  2274. // AuthTime is the time when the initial authentication occurred (UNIX epoch).
  2275. AuthTime uint32
  2276. // StartTime is when the ticket becomes valid (UNIX epoch).
  2277. StartTime uint32
  2278. // EndTime is when the ticket expires (UNIX epoch).
  2279. EndTime uint32
  2280. // RenewTill is likely the latest time the ticket can be renewed (UNIX epoch).
  2281. RenewTill uint32
  2282. // Unknown5 is a possible bitfield.
  2283. Unknown4 uint32
  2284. // Unknown5 is a possible bitfield.
  2285. Unknown5 uint32
  2286. // Unknown6 is a possible bitfield.
  2287. Unknown6 uint32
  2288. // ConnectionMetadata holds metadata used for the next connection (IP address, cookie, etc).
  2289. ConnectionMetadata TLVBlock
  2290. }
  2291. // KerberosBOSServerInfo provides the client with connection parameters for contacting
  2292. // the BOS (Basic OSCAR Service) server.
  2293. //
  2294. // This TLV is typically returned by the server inside a successful Kerberos login response
  2295. // (SNAC 0x050C/0x0003).
  2296. type KerberosBOSServerInfo struct {
  2297. // Unknown may signify a version or feature flag block.
  2298. Unknown uint16
  2299. // ConnectionInfo is a TLV block defining the next server to contact (BOS).
  2300. // Includes IP address, port, session cookie, and other required fields for login.
  2301. ConnectionInfo TLVBlock
  2302. }
  2303. //
  2304. // Misc
  2305. //
  2306. type TLVUserInfo struct {
  2307. ScreenName string `oscar:"len_prefix=uint8"`
  2308. WarningLevel uint16
  2309. TLVBlock
  2310. }
  2311. func (t TLVUserInfo) IsAway() bool {
  2312. flags, _ := t.Uint16BE(OServiceUserInfoUserFlags)
  2313. return flags&OServiceUserFlagUnavailable == OServiceUserFlagUnavailable
  2314. }
  2315. func (t TLVUserInfo) IsInvisible() bool {
  2316. mask, _ := t.Uint32BE(OServiceUserInfoStatus)
  2317. return mask&OServiceUserStatusInvisible == OServiceUserStatusInvisible
  2318. }
  2319. type FeedbagItem struct {
  2320. Name string `oscar:"len_prefix=uint16"`
  2321. GroupID uint16
  2322. ItemID uint16
  2323. ClassID uint16
  2324. TLVLBlock
  2325. }
  2326. // IsEqual reports whether f and other have identical field values, including
  2327. // the same TLVs in the same order with the same data.
  2328. func (f *FeedbagItem) IsEqual(other FeedbagItem) bool {
  2329. if f.Name != other.Name || f.GroupID != other.GroupID || f.ClassID != other.ClassID {
  2330. return false
  2331. }
  2332. if len(f.TLVLBlock.TLVList) != len(other.TLVLBlock.TLVList) {
  2333. return false
  2334. }
  2335. for i, tlv := range f.TLVLBlock.TLVList {
  2336. o := other.TLVLBlock.TLVList[i]
  2337. if tlv.Tag != o.Tag || !bytes.Equal(tlv.Value, o.Value) {
  2338. return false
  2339. }
  2340. }
  2341. return true
  2342. }
  2343. // AppendOrderMembers adds member IDs to the item's order attribute TLV. If
  2344. // the order TLV already exists, the new IDs are appended to it. Otherwise a
  2345. // new order TLV is created.
  2346. func (f *FeedbagItem) AppendOrderMembers(memberIDs ...uint16) {
  2347. if existing, ok := f.Uint16SliceBE(FeedbagAttributesOrder); ok {
  2348. f.Replace(NewTLVBE(FeedbagAttributesOrder, append(existing, memberIDs...)))
  2349. } else {
  2350. f.Append(NewTLVBE(FeedbagAttributesOrder, memberIDs))
  2351. }
  2352. }
  2353. // RemoveOrderMembers removes the specified member IDs from the item's order
  2354. // attribute TLV. IDs not present in the order are ignored.
  2355. func (f *FeedbagItem) RemoveOrderMembers(memberIDs ...uint16) {
  2356. existing, ok := f.Uint16SliceBE(FeedbagAttributesOrder)
  2357. if !ok {
  2358. return
  2359. }
  2360. remove := make(map[uint16]struct{}, len(memberIDs))
  2361. for _, id := range memberIDs {
  2362. remove[id] = struct{}{}
  2363. }
  2364. filtered := make([]uint16, 0, len(existing))
  2365. for _, id := range existing {
  2366. if _, found := remove[id]; !found {
  2367. filtered = append(filtered, id)
  2368. }
  2369. }
  2370. f.Replace(NewTLVBE(FeedbagAttributesOrder, filtered))
  2371. }
  2372. // ICQDCInfo represents ICQ direct connect settings.
  2373. type ICQDCInfo struct {
  2374. IP uint32
  2375. Port uint32
  2376. DCType uint8
  2377. ProtoVersion uint16
  2378. AuthCookie uint32
  2379. WebPort uint32
  2380. ClientFutures uint32
  2381. LastUpdateTime uint32
  2382. LastExtInfoUpdateTime uint32
  2383. LastExtStatusUpdateTime uint32
  2384. Unknown uint16
  2385. }
  2386. //
  2387. // TOC Error Codes
  2388. //
  2389. const (
  2390. // General Errors
  2391. TOCErrorGeneralUserNotAvailable = "901" // followed by screenname
  2392. TOCErrorGeneralWarningUserNotAvailable = "902" // followed by screenname
  2393. TOCErrorGeneralRateLimitHit = "903"
  2394. // Admin Errors
  2395. TOCErrorAdminInvalidInput = "911"
  2396. TOCErrorAdminInvalidAccount = "912"
  2397. TOCErrorAdminProcessingRequest = "913"
  2398. TOCErrorAdminServiceUnavailable = "914"
  2399. // Chat Errors
  2400. TOCErrorChatInChatroomUnavailble = "950" // followed by chatroom
  2401. // IM & Info Errors
  2402. TOCErrorIMSendingMessagesTooFast = "960" // followed by screenname
  2403. TOCErrorIMMissedMessageTooBig = "961" // followed by screenname
  2404. TOCErrorIMMissedMessageTooFast = "962" // followed by screenname
  2405. // DirErrors
  2406. TOCErrorDirFailure = "970"
  2407. TOCErrorDirTooManyMatches = "971"
  2408. TOCErrorDirNeedMoreQualifiers = "972"
  2409. TOCErrorDirServiceUnavailable = "973"
  2410. TOCErrorDirEmailLookupRestricted = "974"
  2411. TOCErrorDirKeywordIgnored = "975"
  2412. TOCErrorDirNoKeywords = "976"
  2413. TOCErrorDirLanguageNotSupported = "977"
  2414. TOCErrorDirCountryNotSupported = "978"
  2415. TOCErrorDirFailureUnknown = "979" // followed by error msg (or a SubErrorCode?)
  2416. // Auth Errors
  2417. TOCErrorAuthIncorrectNickOrPassword = "980"
  2418. TOCErrorAuthServiceUnavailable = "981"
  2419. TOCErrorAuthWarningTooHigh = "982"
  2420. TOCErrorAuthRatedFromLogin = "983"
  2421. TOCErrorAuthUnknownError = "989" // followed by SubErrorCode
  2422. TOCErrorAuthUnknownSubErrorSignOnTooSoon = "0"
  2423. TOCErrorAuthUnknownSubErrorInvalidScreennameOrPassword = "7"
  2424. TOCErrorAuthUnknownSubErrorSuspendedAccount = "17"
  2425. )
  2426. //
  2427. // TOC2 Error Codes
  2428. //
  2429. const (
  2430. // Chat Error Codes
  2431. TO2CErrorChatJoinError = "951" // followed by chatroom:SubErrorCode
  2432. TOC2ErrorChatJoinSubErrorReset = "-1"
  2433. TOC2ErrorChatJoinSubErrorChatFull = "24"
  2434. TOC2ErrorChatJoinSubErrorRated = "48"
  2435. TOC2ErrorChatJoinSubErrorEjected = "74"
  2436. )