mirror of
https://github.com/chatmail/core.git
synced 2026-05-19 14:56:33 +03:00
Merge branch 'master' into flub-nowarn
This commit is contained in:
@@ -259,7 +259,7 @@ pub unsafe fn dc_contact_empty(mut contact: *mut dc_contact_t) {
|
||||
/* address is in our address book */
|
||||
/* set on Alice's side for contacts like Bob that have scanned the QR code offered by her. Only means the contact has once been established using the "securejoin" procedure in the past, getting the current key verification status requires calling dc_contact_is_verified() ! */
|
||||
/* set on Bob's side for contacts scanned and verified from a QR code. Only means the contact has once been established using the "securejoin" procedure in the past, getting the current key verification status requires calling dc_contact_is_verified() ! */
|
||||
/* contact added mannually by dc_create_contact(), this should be the largets origin as otherwise the user cannot modify the names */
|
||||
/* contact added manually by dc_create_contact(), this should be the largets origin as otherwise the user cannot modify the names */
|
||||
/* contacts with at least this origin value are shown in the contact list */
|
||||
/* contacts with at least this origin value are verified and known not to be spam */
|
||||
/* contacts with at least this origin value start a new "normal" chat, defaults to off */
|
||||
@@ -277,15 +277,12 @@ pub unsafe fn dc_contact_load_from_db(
|
||||
if contact_id == 1 as libc::c_uint {
|
||||
(*contact).id = contact_id;
|
||||
(*contact).name = dc_stock_str((*contact).context, 2);
|
||||
(*contact).addr = dc_strdup(
|
||||
to_cstring(
|
||||
(*contact)
|
||||
.context
|
||||
.sql
|
||||
.get_config((*contact).context, "configured_addr")
|
||||
.unwrap_or_default(),
|
||||
)
|
||||
.as_ptr(),
|
||||
(*contact).addr = to_cstring(
|
||||
(*contact)
|
||||
.context
|
||||
.sql
|
||||
.get_config((*contact).context, "configured_addr")
|
||||
.unwrap_or_default(),
|
||||
);
|
||||
true
|
||||
} else {
|
||||
@@ -294,11 +291,11 @@ pub unsafe fn dc_contact_load_from_db(
|
||||
params![contact_id as i32],
|
||||
|row| {
|
||||
(*contact).id = contact_id;
|
||||
(*contact).name = dc_strdup(to_cstring(row.get::<_, String>(0)?).as_ptr());
|
||||
(*contact).addr = dc_strdup(to_cstring(row.get::<_, String>(1)?).as_ptr());
|
||||
(*contact).name = to_cstring(row.get::<_, String>(0)?);
|
||||
(*contact).addr = to_cstring(row.get::<_, String>(1)?);
|
||||
(*contact).origin = row.get(2)?;
|
||||
(*contact).blocked = row.get(3)?;
|
||||
(*contact).authname = dc_strdup(to_cstring(row.get::<_, String>(4)?).as_ptr());
|
||||
(*contact).blocked = row.get::<_, Option<i32>>(3)?.unwrap_or_default();
|
||||
(*contact).authname = to_cstring(row.get::<_, String>(4)?);
|
||||
Ok(())
|
||||
}
|
||||
).is_ok()
|
||||
@@ -736,7 +733,7 @@ pub unsafe fn dc_get_contact_encrinfo(
|
||||
free(fingerprint_other_verified as *mut libc::c_void);
|
||||
free(fingerprint_other_unverified as *mut libc::c_void);
|
||||
|
||||
strdup(to_cstring(ret).as_ptr())
|
||||
to_cstring(ret)
|
||||
}
|
||||
|
||||
unsafe fn cat_fingerprint(
|
||||
@@ -906,7 +903,7 @@ pub fn dc_contact_get_profile_image(contact: *const dc_contact_t) -> *mut libc::
|
||||
if unsafe { (*contact).id } == 1 {
|
||||
let context = unsafe { (*contact) }.context;
|
||||
if let Some(avatar) = context.get_config(config::Config::Selfavatar) {
|
||||
image_abs = unsafe { dc_strdup(to_cstring(avatar).as_ptr()) };
|
||||
image_abs = unsafe { to_cstring(avatar) };
|
||||
}
|
||||
}
|
||||
// TODO: else get image_abs from contact param
|
||||
|
||||
Reference in New Issue
Block a user