mirror of
https://github.com/amigan/aim-oscar-server.git
synced 2024-11-21 12:09:48 -05:00
local db, write TLV for message routine
This commit is contained in:
parent
7b37595f2b
commit
19cf364c78
3 changed files with 10 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,3 +2,4 @@ node_modules
|
||||||
built
|
built
|
||||||
dist
|
dist
|
||||||
aim-oscar
|
aim-oscar
|
||||||
|
aim.db
|
||||||
|
|
7
main.go
7
main.go
|
@ -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")
|
||||||
|
|
|
@ -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: []
|
||||||
|
|
Loading…
Reference in a new issue