mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
target comments of @flub
This commit is contained in:
committed by
holger krekel
parent
f8afefa2c1
commit
4c30bf80ce
@@ -2766,7 +2766,7 @@ int dc_chat_is_device_talk (const dc_chat_t* chat);
|
||||
* @param chat The chat object.
|
||||
* @return 1=chat is writable, 0=chat is not writable
|
||||
*/
|
||||
int dc_chat_is_writable (const dc_chat_t* chat);
|
||||
int dc_chat_can_send (const dc_chat_t* chat);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -2292,13 +2292,13 @@ pub unsafe extern "C" fn dc_chat_is_device_talk(chat: *mut dc_chat_t) -> libc::c
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn dc_chat_is_writable(chat: *mut dc_chat_t) -> libc::c_int {
|
||||
pub unsafe extern "C" fn dc_chat_can_send(chat: *mut dc_chat_t) -> libc::c_int {
|
||||
if chat.is_null() {
|
||||
eprintln!("ignoring careless call to dc_chat_is_writable()");
|
||||
eprintln!("ignoring careless call to dc_chat_can_send()");
|
||||
return 0;
|
||||
}
|
||||
let ffi_chat = &*chat;
|
||||
ffi_chat.chat.is_writable() as libc::c_int
|
||||
ffi_chat.chat.can_send() as libc::c_int
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
||||
@@ -115,7 +115,7 @@ impl Chat {
|
||||
self.param.exists(Param::Devicetalk)
|
||||
}
|
||||
|
||||
pub fn is_writable(&self) -> bool {
|
||||
pub fn can_send(&self) -> bool {
|
||||
self.id > DC_CHAT_ID_LAST_SPECIAL && !self.is_device_talk()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user