local db, write TLV for message routine

This commit is contained in:
Artem Titoulenko 2021-12-18 22:47:57 -05:00
parent 7b37595f2b
commit 19cf364c78
3 changed files with 10 additions and 1 deletions

1
.gitignore vendored
View file

@ -2,3 +2,4 @@ node_modules
built built
dist dist
aim-oscar aim-oscar
aim.db

View file

@ -45,7 +45,7 @@ func RegisterService(family uint16, service Service) {
func main() { func main() {
// Set up the DB // Set up the DB
sqldb, err := sql.Open(sqliteshim.ShimName, "file::memory:?cache=shared") sqldb, err := sql.Open(sqliteshim.ShimName, "file:aim.db")
if err != nil { if err != nil {
panic(err) panic(err)
} }
@ -102,6 +102,11 @@ func main() {
// Length of TLVs in fixed part // Length of TLVs in fixed part
messageSnac.Data.WriteUint16(uint16(len(tlvs))) messageSnac.Data.WriteUint16(uint16(len(tlvs)))
// Write all of the TLVs to the SNAC
for _, tlv := range tlvs {
messageSnac.Data.WriteBinary(tlv)
}
frag := oscar.Buffer{} frag := oscar.Buffer{}
frag.Write([]byte{5, 1, 0, 4, 1, 1, 1, 1}) // TODO: first fragment [id, version, len, len, (cap * len)... ] frag.Write([]byte{5, 1, 0, 4, 1, 1, 1, 1}) // TODO: first fragment [id, version, len, len, (cap * len)... ]
frag.Write([]byte{1, 1}) // message text fragment start (this is a busted "TLV") frag.Write([]byte{1, 1}) // message text fragment start (this is a busted "TLV")

View file

@ -3,5 +3,8 @@
- username: toof - username: toof
password: bar password: bar
email: toof@plot.club email: toof@plot.club
- username: artem
password: bar
email: artem@plot.club
- model: Message - model: Message
rows: [] rows: []