@@ -7,7 +7,11 @@ import (
7
7
"github.com/krypton-byte/neonize/utils"
8
8
"google.golang.org/protobuf/proto"
9
9
)
10
- import "go.mau.fi/whatsmeow/store"
10
+ import (
11
+ "context"
12
+
13
+ "go.mau.fi/whatsmeow/store"
14
+ )
11
15
12
16
//export PutPushName
13
17
func PutPushName (id * C.char , user * C.uchar , userSize C.int , pushname * C.char ) C.struct_BytesReturn {
@@ -17,7 +21,7 @@ func PutPushName(id *C.char, user *C.uchar, userSize C.int, pushname *C.char) C.
17
21
panic (err )
18
22
}
19
23
return_ := defproto.ContactsPutPushNameReturnFunction {}
20
- status , prev_name , err := clients [C .GoString (id )].Store .Contacts .PutPushName (utils .DecodeJidProto (& userJID ), C .GoString (pushname ))
24
+ status , prev_name , err := clients [C .GoString (id )].Store .Contacts .PutPushName (context . Background (), utils .DecodeJidProto (& userJID ), C .GoString (pushname ))
21
25
return_ .PreviousName = proto .String (prev_name )
22
26
return_ .Status = & status
23
27
if err != nil {
@@ -38,7 +42,7 @@ func PutBusinessName(id *C.char, user *C.uchar, userSize C.int, businessName *C.
38
42
panic (err )
39
43
}
40
44
return_ := defproto.ContactsPutPushNameReturnFunction {}
41
- status , prev_name , err := clients [C .GoString (id )].Store .Contacts .PutBusinessName (utils .DecodeJidProto (& userJID ), C .GoString (businessName ))
45
+ status , prev_name , err := clients [C .GoString (id )].Store .Contacts .PutBusinessName (context . Background (), utils .DecodeJidProto (& userJID ), C .GoString (businessName ))
42
46
return_ .PreviousName = proto .String (prev_name )
43
47
return_ .Status = & status
44
48
if err != nil {
@@ -58,7 +62,7 @@ func PutContactName(id *C.char, user *C.uchar, userSize C.int, fullName, firstNa
58
62
if err != nil {
59
63
panic (err )
60
64
}
61
- err_ := clients [C .GoString (id )].Store .Contacts .PutContactName (utils .DecodeJidProto (& userJID ), C .GoString (fullName ), C .GoString (firstName ))
65
+ err_ := clients [C .GoString (id )].Store .Contacts .PutContactName (context . Background (), utils .DecodeJidProto (& userJID ), C .GoString (fullName ), C .GoString (firstName ))
62
66
if err_ != nil {
63
67
return C .CString (err_ .Error ())
64
68
}
@@ -76,7 +80,7 @@ func PutAllContactNames(id *C.char, contacts *C.uchar, contactsSize C.int) *C.ch
76
80
for i , centry := range entry .ContactEntry {
77
81
contactEntry [i ] = * utils .DecodeContactEntry (centry )
78
82
}
79
- err_r := clients [C .GoString (id )].Store .Contacts .PutAllContactNames (contactEntry )
83
+ err_r := clients [C .GoString (id )].Store .Contacts .PutAllContactNames (context . Background (), contactEntry )
80
84
if err_r != nil {
81
85
return C .CString (err_r .Error ())
82
86
}
@@ -90,7 +94,7 @@ func GetContact(id *C.char, user *C.uchar, userSize C.int) C.struct_BytesReturn
90
94
if err != nil {
91
95
panic (err )
92
96
}
93
- contact_info , err_ := clients [C .GoString (id )].Store .Contacts .GetContact (utils .DecodeJidProto (& userJID ))
97
+ contact_info , err_ := clients [C .GoString (id )].Store .Contacts .GetContact (context . Background (), utils .DecodeJidProto (& userJID ))
94
98
return_ := defproto.ContactsGetContactReturnFunction {
95
99
ContactInfo : utils .EncodeContactInfo (contact_info ),
96
100
}
@@ -106,7 +110,7 @@ func GetContact(id *C.char, user *C.uchar, userSize C.int) C.struct_BytesReturn
106
110
107
111
//export GetAllContacts
108
112
func GetAllContacts (id * C.char ) C.struct_BytesReturn {
109
- contacts , err := clients [C .GoString (id )].Store .Contacts .GetAllContacts ()
113
+ contacts , err := clients [C .GoString (id )].Store .Contacts .GetAllContacts (context . Background () )
110
114
return_ := defproto.ContactsGetAllContactsReturnFunction {
111
115
Contact : utils .EncodeContacts (contacts ),
112
116
}
0 commit comments