refactor(chat): rename dc_chat to chat

This commit is contained in:
dignifiedquire
2019-08-14 20:50:33 +02:00
parent c8ce099f22
commit 64117c2964
18 changed files with 57 additions and 57 deletions

View File

@@ -322,7 +322,7 @@ pub unsafe extern "C" fn dc_create_chat_by_msg_id(context: *mut dc_context_t, ms
assert!(!context.is_null());
let context = &*context;
dc_chat::dc_create_chat_by_msg_id(context, msg_id)
chat::dc_create_chat_by_msg_id(context, msg_id)
}
#[no_mangle]
@@ -333,7 +333,7 @@ pub unsafe extern "C" fn dc_create_chat_by_contact_id(
assert!(!context.is_null());
let context = &*context;
dc_chat::dc_create_chat_by_contact_id(context, contact_id)
chat::dc_create_chat_by_contact_id(context, contact_id)
}
#[no_mangle]
@@ -344,7 +344,7 @@ pub unsafe extern "C" fn dc_get_chat_id_by_contact_id(
assert!(!context.is_null());
let context = &*context;
dc_chat::dc_get_chat_id_by_contact_id(context, contact_id)
chat::dc_get_chat_id_by_contact_id(context, contact_id)
}
#[no_mangle]
@@ -357,7 +357,7 @@ pub unsafe extern "C" fn dc_prepare_msg(
assert!(!msg.is_null());
let context = &*context;
dc_chat::dc_prepare_msg(context, chat_id, msg)
chat::dc_prepare_msg(context, chat_id, msg)
}
#[no_mangle]
@@ -370,7 +370,7 @@ pub unsafe extern "C" fn dc_send_msg(
assert!(!msg.is_null());
let context = &*context;
dc_chat::dc_send_msg(context, chat_id, msg)
chat::dc_send_msg(context, chat_id, msg)
}
#[no_mangle]
@@ -384,7 +384,7 @@ pub unsafe extern "C" fn dc_send_text_msg(
let context = &*context;
let text_to_send = dc_tools::to_string_lossy(text_to_send);
dc_chat::dc_send_text_msg(context, chat_id, text_to_send)
chat::dc_send_text_msg(context, chat_id, text_to_send)
}
#[no_mangle]
@@ -396,7 +396,7 @@ pub unsafe extern "C" fn dc_set_draft(
assert!(!context.is_null());
let context = &*context;
dc_chat::dc_set_draft(context, chat_id, msg)
chat::dc_set_draft(context, chat_id, msg)
}
#[no_mangle]
@@ -407,7 +407,7 @@ pub unsafe extern "C" fn dc_get_draft<'a>(
assert!(!context.is_null());
let context = &*context;
dc_chat::dc_get_draft(context, chat_id)
chat::dc_get_draft(context, chat_id)
}
#[no_mangle]
@@ -420,7 +420,7 @@ pub unsafe extern "C" fn dc_get_chat_msgs(
assert!(!context.is_null());
let context = &*context;
dc_chat::dc_get_chat_msgs(context, chat_id, flags, marker1before)
chat::dc_get_chat_msgs(context, chat_id, flags, marker1before)
}
#[no_mangle]
@@ -428,7 +428,7 @@ pub unsafe extern "C" fn dc_get_msg_cnt(context: *mut dc_context_t, chat_id: u32
assert!(!context.is_null());
let context = &*context;
dc_chat::dc_get_msg_cnt(context, chat_id)
chat::dc_get_msg_cnt(context, chat_id)
}
#[no_mangle]
@@ -439,7 +439,7 @@ pub unsafe extern "C" fn dc_get_fresh_msg_cnt(
assert!(!context.is_null());
let context = &*context;
dc_chat::dc_get_fresh_msg_cnt(context, chat_id)
chat::dc_get_fresh_msg_cnt(context, chat_id)
}
#[no_mangle]
@@ -457,7 +457,7 @@ pub unsafe extern "C" fn dc_marknoticed_chat(context: *mut dc_context_t, chat_id
assert!(!context.is_null());
let context = &*context;
dc_chat::dc_marknoticed_chat(context, chat_id);
chat::dc_marknoticed_chat(context, chat_id);
}
#[no_mangle]
@@ -465,7 +465,7 @@ pub unsafe extern "C" fn dc_marknoticed_all_chats(context: *mut dc_context_t) {
assert!(!context.is_null());
let context = &*context;
dc_chat::dc_marknoticed_all_chats(context);
chat::dc_marknoticed_all_chats(context);
}
fn from_prim<S, T>(s: S) -> Option<T>
@@ -493,7 +493,7 @@ pub unsafe extern "C" fn dc_get_chat_media(
let or_msg_type3 =
from_prim(or_msg_type3).expect(&format!("incorrect or_msg_type3 = {}", or_msg_type3));
dc_chat::dc_get_chat_media(context, chat_id, msg_type, or_msg_type2, or_msg_type3)
chat::dc_get_chat_media(context, chat_id, msg_type, or_msg_type2, or_msg_type3)
}
#[no_mangle]
@@ -514,7 +514,7 @@ pub unsafe extern "C" fn dc_get_next_media(
let or_msg_type3 =
from_prim(or_msg_type3).expect(&format!("incorrect or_msg_type3 = {}", or_msg_type3));
dc_chat::dc_get_next_media(context, msg_id, dir, msg_type, or_msg_type2, or_msg_type3)
chat::dc_get_next_media(context, msg_id, dir, msg_type, or_msg_type2, or_msg_type3)
}
#[no_mangle]
@@ -526,7 +526,7 @@ pub unsafe extern "C" fn dc_archive_chat(
assert!(!context.is_null());
let context = &*context;
dc_chat::dc_archive_chat(context, chat_id, archive);
chat::dc_archive_chat(context, chat_id, archive);
}
#[no_mangle]
@@ -535,7 +535,7 @@ pub unsafe extern "C" fn dc_delete_chat(context: *mut dc_context_t, chat_id: u32
let context = &*context;
// TODO: update to indicate public api success/failure of deletion
dc_chat::dc_delete_chat(context, chat_id);
chat::dc_delete_chat(context, chat_id);
}
#[no_mangle]
@@ -546,7 +546,7 @@ pub unsafe extern "C" fn dc_get_chat_contacts(
assert!(!context.is_null());
let context = &*context;
dc_array_t::from(dc_chat::dc_get_chat_contacts(context, chat_id)).into_raw()
dc_array_t::from(chat::dc_get_chat_contacts(context, chat_id)).into_raw()
}
#[no_mangle]
@@ -570,7 +570,7 @@ pub unsafe extern "C" fn dc_get_chat<'a>(
assert!(!context.is_null());
let context = &*context;
dc_chat::dc_get_chat(context, chat_id)
chat::dc_get_chat(context, chat_id)
}
#[no_mangle]
@@ -583,7 +583,7 @@ pub unsafe extern "C" fn dc_create_group_chat(
assert!(!name.is_null());
let context = &*context;
dc_chat::dc_create_group_chat(context, verified, name)
chat::dc_create_group_chat(context, verified, name)
}
#[no_mangle]
@@ -595,7 +595,7 @@ pub unsafe extern "C" fn dc_is_contact_in_chat(
assert!(!context.is_null());
let context = &*context;
dc_chat::dc_is_contact_in_chat(context, chat_id, contact_id)
chat::dc_is_contact_in_chat(context, chat_id, contact_id)
}
#[no_mangle]
@@ -607,7 +607,7 @@ pub unsafe extern "C" fn dc_add_contact_to_chat(
assert!(!context.is_null());
let context = &*context;
dc_chat::dc_add_contact_to_chat(context, chat_id, contact_id)
chat::dc_add_contact_to_chat(context, chat_id, contact_id)
}
#[no_mangle]
@@ -619,7 +619,7 @@ pub unsafe extern "C" fn dc_remove_contact_from_chat(
assert!(!context.is_null());
let context = &*context;
dc_chat::dc_remove_contact_from_chat(context, chat_id, contact_id)
chat::dc_remove_contact_from_chat(context, chat_id, contact_id)
}
#[no_mangle]
@@ -633,7 +633,7 @@ pub unsafe extern "C" fn dc_set_chat_name(
assert!(chat_id > constants::DC_CHAT_ID_LAST_SPECIAL as u32);
let context = &*context;
dc_chat::dc_set_chat_name(context, chat_id, name)
chat::dc_set_chat_name(context, chat_id, name)
}
#[no_mangle]
@@ -646,7 +646,7 @@ pub unsafe extern "C" fn dc_set_chat_profile_image(
assert!(chat_id > constants::DC_CHAT_ID_LAST_SPECIAL as u32);
let context = &*context;
dc_chat::dc_set_chat_profile_image(context, chat_id, image)
chat::dc_set_chat_profile_image(context, chat_id, image)
}
#[no_mangle]
@@ -698,7 +698,7 @@ pub unsafe extern "C" fn dc_forward_msgs(
assert!(chat_id > constants::DC_CHAT_ID_LAST_SPECIAL as u32);
let context = &*context;
dc_chat::dc_forward_msgs(context, msg_ids, msg_cnt, chat_id)
chat::dc_forward_msgs(context, msg_ids, msg_cnt, chat_id)
}
#[no_mangle]
@@ -1256,90 +1256,90 @@ pub unsafe extern "C" fn dc_chatlist_get_context(
// dc_chat_t
#[no_mangle]
pub type dc_chat_t<'a> = dc_chat::Chat<'a>;
pub type dc_chat_t<'a> = chat::Chat<'a>;
#[no_mangle]
pub unsafe extern "C" fn dc_chat_unref(chat: *mut dc_chat_t) {
assert!(!chat.is_null());
dc_chat::dc_chat_unref(chat)
chat::dc_chat_unref(chat)
}
#[no_mangle]
pub unsafe extern "C" fn dc_chat_get_id(chat: *mut dc_chat_t) -> u32 {
assert!(!chat.is_null());
dc_chat::dc_chat_get_id(chat)
chat::dc_chat_get_id(chat)
}
#[no_mangle]
pub unsafe extern "C" fn dc_chat_get_type(chat: *mut dc_chat_t) -> libc::c_int {
assert!(!chat.is_null());
dc_chat::dc_chat_get_type(chat) as libc::c_int
chat::dc_chat_get_type(chat) as libc::c_int
}
#[no_mangle]
pub unsafe extern "C" fn dc_chat_get_name(chat: *mut dc_chat_t) -> *mut libc::c_char {
assert!(!chat.is_null());
dc_chat::dc_chat_get_name(chat)
chat::dc_chat_get_name(chat)
}
#[no_mangle]
pub unsafe extern "C" fn dc_chat_get_subtitle(chat: *mut dc_chat_t) -> *mut libc::c_char {
assert!(!chat.is_null());
dc_chat::dc_chat_get_subtitle(chat)
chat::dc_chat_get_subtitle(chat)
}
#[no_mangle]
pub unsafe extern "C" fn dc_chat_get_profile_image(chat: *mut dc_chat_t) -> *mut libc::c_char {
assert!(!chat.is_null());
dc_chat::dc_chat_get_profile_image(chat)
chat::dc_chat_get_profile_image(chat)
}
#[no_mangle]
pub unsafe extern "C" fn dc_chat_get_color(chat: *mut dc_chat_t) -> u32 {
assert!(!chat.is_null());
dc_chat::dc_chat_get_color(chat)
chat::dc_chat_get_color(chat)
}
#[no_mangle]
pub unsafe extern "C" fn dc_chat_get_archived(chat: *mut dc_chat_t) -> libc::c_int {
assert!(!chat.is_null());
dc_chat::dc_chat_get_archived(chat) as libc::c_int
chat::dc_chat_get_archived(chat) as libc::c_int
}
#[no_mangle]
pub unsafe extern "C" fn dc_chat_is_unpromoted(chat: *mut dc_chat_t) -> libc::c_int {
assert!(!chat.is_null());
dc_chat::dc_chat_is_unpromoted(chat)
chat::dc_chat_is_unpromoted(chat)
}
#[no_mangle]
pub unsafe extern "C" fn dc_chat_is_self_talk(chat: *mut dc_chat_t) -> libc::c_int {
assert!(!chat.is_null());
dc_chat::dc_chat_is_self_talk(chat)
chat::dc_chat_is_self_talk(chat)
}
#[no_mangle]
pub unsafe extern "C" fn dc_chat_is_verified(chat: *mut dc_chat_t) -> libc::c_int {
assert!(!chat.is_null());
dc_chat::dc_chat_is_verified(chat)
chat::dc_chat_is_verified(chat)
}
#[no_mangle]
pub unsafe extern "C" fn dc_chat_is_sending_locations(chat: *mut dc_chat_t) -> libc::c_int {
assert!(!chat.is_null());
dc_chat::dc_chat_is_sending_locations(chat) as libc::c_int
chat::dc_chat_is_sending_locations(chat) as libc::c_int
}
// dc_msg_t

View File

@@ -1,13 +1,13 @@
use std::ffi::CString;
use std::str::FromStr;
use deltachat::chat::*;
use deltachat::chatlist::*;
use deltachat::config;
use deltachat::constants::*;
use deltachat::contact::*;
use deltachat::context::*;
use deltachat::dc_array::*;
use deltachat::dc_chat::*;
use deltachat::dc_configure::*;
use deltachat::dc_imex::*;
use deltachat::dc_job::*;

View File

@@ -5,12 +5,12 @@ use std::sync::{Arc, RwLock};
use std::{thread, time};
use tempfile::tempdir;
use deltachat::chat::*;
use deltachat::chatlist::*;
use deltachat::config;
use deltachat::constants::Event;
use deltachat::contact::*;
use deltachat::context::*;
use deltachat::dc_chat::*;
use deltachat::dc_configure::*;
use deltachat::dc_job::{
dc_perform_imap_fetch, dc_perform_imap_idle, dc_perform_imap_jobs, dc_perform_smtp_idle,

View File

@@ -1,7 +1,7 @@
use crate::chat::*;
use crate::constants::*;
use crate::contact::*;
use crate::context::*;
use crate::dc_chat::*;
use crate::dc_lot::*;
use crate::dc_msg::*;
use crate::dc_tools::*;

View File

@@ -1,9 +1,9 @@
use std::sync::{Arc, Condvar, Mutex, RwLock};
use crate::chat::*;
use crate::constants::*;
use crate::contact::*;
use crate::dc_array::*;
use crate::dc_chat::*;
use crate::dc_job::*;
use crate::dc_jobthread::*;
use crate::dc_loginparam::*;

View File

@@ -6,10 +6,10 @@ use mmime::mmapstring::*;
use mmime::other::*;
use rand::{thread_rng, Rng};
use crate::chat::*;
use crate::config::Config;
use crate::constants::*;
use crate::context::Context;
use crate::dc_chat::*;
use crate::dc_configure::*;
use crate::dc_e2ee::*;
use crate::dc_job::*;

View File

@@ -6,9 +6,9 @@ use std::time::Duration;
use rand::{thread_rng, Rng};
use crate::chat::*;
use crate::constants::*;
use crate::context::Context;
use crate::dc_chat::*;
use crate::dc_configure::*;
use crate::dc_imex::*;
use crate::dc_jobthread::*;

View File

@@ -3,10 +3,10 @@ use std::ffi::CString;
use quick_xml;
use quick_xml::events::{BytesEnd, BytesStart, BytesText};
use crate::chat::*;
use crate::constants::Event;
use crate::constants::*;
use crate::context::*;
use crate::dc_chat::*;
use crate::dc_job::*;
use crate::dc_msg::*;
use crate::dc_tools::*;

View File

@@ -1,7 +1,7 @@
use crate::chat::*;
use crate::constants::Chattype;
use crate::contact::*;
use crate::context::Context;
use crate::dc_chat::*;
use crate::dc_msg::*;
use crate::dc_tools::*;
use crate::stock::StockMessage;

View File

@@ -10,10 +10,10 @@ use mmime::mailmime_write_mem::*;
use mmime::mmapstring::*;
use mmime::other::*;
use crate::chat::*;
use crate::constants::*;
use crate::contact::*;
use crate::context::{dc_get_version_str, Context};
use crate::dc_chat::*;
use crate::dc_e2ee::*;
use crate::dc_location::*;
use crate::dc_msg::*;

View File

@@ -1,10 +1,10 @@
use std::ffi::CString;
use std::path::Path;
use crate::chat::*;
use crate::constants::*;
use crate::contact::*;
use crate::context::*;
use crate::dc_chat::*;
use crate::dc_job::*;
use crate::dc_lot::dc_lot_t;
use crate::dc_lot::*;

View File

@@ -1,9 +1,9 @@
use percent_encoding::percent_decode_str;
use crate::chat::*;
use crate::constants::Blocked;
use crate::contact::*;
use crate::context::Context;
use crate::dc_chat::*;
use crate::dc_lot::*;
use crate::dc_strencode::*;
use crate::dc_tools::*;

View File

@@ -1,5 +1,6 @@
use itertools::join;
use std::ptr;
use itertools::join;
use mmime::mailimf::*;
use mmime::mailimf_types::*;
use mmime::mailmime::*;
@@ -8,12 +9,11 @@ use mmime::mailmime_types::*;
use mmime::mmapstring::*;
use mmime::other::*;
use sha2::{Digest, Sha256};
use std::ptr;
use crate::chat::*;
use crate::constants::*;
use crate::contact::*;
use crate::context::Context;
use crate::dc_chat::*;
use crate::dc_job::*;
use crate::dc_location::*;
use crate::dc_mimeparser::*;

View File

@@ -4,10 +4,10 @@ use mmime::mailimf_types::*;
use percent_encoding::{utf8_percent_encode, NON_ALPHANUMERIC};
use crate::aheader::EncryptPreference;
use crate::chat::*;
use crate::constants::*;
use crate::contact::*;
use crate::context::Context;
use crate::dc_chat::*;
use crate::dc_configure::*;
use crate::dc_e2ee::*;
use crate::dc_lot::*;

View File

@@ -23,6 +23,7 @@ mod log;
mod error;
mod aheader;
pub mod chat;
pub mod chatlist;
pub mod config;
pub mod constants;
@@ -42,7 +43,6 @@ pub mod types;
pub mod x;
pub mod dc_array;
pub mod dc_chat;
pub mod dc_configure;
mod dc_dehtml;
mod dc_e2ee;

View File

@@ -4,9 +4,9 @@ use std::fmt;
use num_traits::FromPrimitive;
use crate::aheader::*;
use crate::chat::*;
use crate::constants::*;
use crate::context::Context;
use crate::dc_chat::*;
use crate::key::*;
use crate::sql::{self, Sql};

View File

@@ -6,11 +6,11 @@ use std::ffi::CString;
use mmime::mailimf_types::*;
use tempfile::{tempdir, TempDir};
use deltachat::chat::*;
use deltachat::config;
use deltachat::constants::*;
use deltachat::contact::*;
use deltachat::context::*;
use deltachat::dc_chat::*;
use deltachat::dc_configure::*;
use deltachat::dc_imex::*;
use deltachat::dc_lot::*;