diff --git a/.gitignore b/.gitignore index d5b33ed..fe0aa27 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ node_modules built dist aim-oscar +aim.db diff --git a/main.go b/main.go index fec709a..dd03783 100644 --- a/main.go +++ b/main.go @@ -45,7 +45,7 @@ func RegisterService(family uint16, service Service) { func main() { // 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 { panic(err) } @@ -102,6 +102,11 @@ func main() { // Length of TLVs in fixed part 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.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") diff --git a/models/fixtures.yml b/models/fixtures.yml index 5147a73..13d487b 100644 --- a/models/fixtures.yml +++ b/models/fixtures.yml @@ -3,5 +3,8 @@ - username: toof password: bar email: toof@plot.club + - username: artem + password: bar + email: artem@plot.club - model: Message rows: []