File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed
deltachat-jsonrpc/src/api/types Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -5072,6 +5072,15 @@ int dc_contact_is_blocked (const dc_contact_t* contact);
5072
5072
*/
5073
5073
int dc_contact_is_verified (dc_contact_t * contact );
5074
5074
5075
+ /**
5076
+ * Returns whether contact is a bot.
5077
+ *
5078
+ * @memberof dc_contact_t
5079
+ * @param contact The contact object.
5080
+ * @return 0 if the contact is not a bot, 1 otherwise.
5081
+ */
5082
+ int dc_contact_is_bot (dc_contact_t * contact );
5083
+
5075
5084
5076
5085
/**
5077
5086
* Return the contact ID that verified a contact.
Original file line number Diff line number Diff line change @@ -4132,6 +4132,15 @@ pub unsafe extern "C" fn dc_contact_is_verified(contact: *mut dc_contact_t) -> l
4132
4132
}
4133
4133
}
4134
4134
4135
+ #[ no_mangle]
4136
+ pub unsafe extern "C" fn dc_contact_is_bot ( contact : * mut dc_contact_t ) -> libc:: c_int {
4137
+ if contact. is_null ( ) {
4138
+ eprintln ! ( "ignoring careless call to dc_contact_is_bot()" ) ;
4139
+ return 0 ;
4140
+ }
4141
+ ( * contact) . contact . is_bot ( ) as libc:: c_int
4142
+ }
4143
+
4135
4144
#[ no_mangle]
4136
4145
pub unsafe extern "C" fn dc_contact_get_verifier_id ( contact : * mut dc_contact_t ) -> u32 {
4137
4146
if contact. is_null ( ) {
Original file line number Diff line number Diff line change @@ -45,6 +45,9 @@ pub struct ContactObject {
45
45
/// the contact's last seen timestamp
46
46
last_seen : i64 ,
47
47
was_seen_recently : bool ,
48
+
49
+ /// If the contact is a bot.
50
+ is_bot : bool ,
48
51
}
49
52
50
53
impl ContactObject {
@@ -80,6 +83,7 @@ impl ContactObject {
80
83
verifier_id,
81
84
last_seen : contact. last_seen ( ) ,
82
85
was_seen_recently : contact. was_seen_recently ( ) ,
86
+ is_bot : contact. is_bot ( ) ,
83
87
} )
84
88
}
85
89
}
You can’t perform that action at this time.
0 commit comments