mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 17:36:29 +03:00
remove unused function dc_marknoticed_all_chats()
This commit is contained in:
@@ -1123,7 +1123,7 @@ dc_array_t* dc_get_fresh_msgs (dc_context_t* context);
|
|||||||
* (IMAP/MDNs is not done for noticed messages).
|
* (IMAP/MDNs is not done for noticed messages).
|
||||||
*
|
*
|
||||||
* Calling this function usually results in the event #DC_EVENT_MSGS_NOTICED.
|
* Calling this function usually results in the event #DC_EVENT_MSGS_NOTICED.
|
||||||
* See also dc_marknoticed_all_chats(), dc_marknoticed_contact() and dc_markseen_msgs().
|
* See also dc_marknoticed_contact() and dc_markseen_msgs().
|
||||||
*
|
*
|
||||||
* @memberof dc_context_t
|
* @memberof dc_context_t
|
||||||
* @param context The context object as returned from dc_context_new().
|
* @param context The context object as returned from dc_context_new().
|
||||||
@@ -1133,16 +1133,6 @@ dc_array_t* dc_get_fresh_msgs (dc_context_t* context);
|
|||||||
void dc_marknoticed_chat (dc_context_t* context, uint32_t chat_id);
|
void dc_marknoticed_chat (dc_context_t* context, uint32_t chat_id);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Same as dc_marknoticed_chat() but for _all_ chats.
|
|
||||||
*
|
|
||||||
* @memberof dc_context_t
|
|
||||||
* @param context The context object as returned from dc_context_new().
|
|
||||||
* @return None.
|
|
||||||
*/
|
|
||||||
void dc_marknoticed_all_chats (dc_context_t* context);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns all message IDs of the given types in a chat.
|
* Returns all message IDs of the given types in a chat.
|
||||||
* Typically used to show a gallery.
|
* Typically used to show a gallery.
|
||||||
|
|||||||
@@ -973,22 +973,6 @@ pub unsafe extern "C" fn dc_marknoticed_chat(context: *mut dc_context_t, chat_id
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
|
||||||
pub unsafe extern "C" fn dc_marknoticed_all_chats(context: *mut dc_context_t) {
|
|
||||||
if context.is_null() {
|
|
||||||
eprintln!("ignoring careless call to dc_marknoticed_all_chats()");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let ctx = &*context;
|
|
||||||
|
|
||||||
block_on(async move {
|
|
||||||
chat::marknoticed_all_chats(&ctx)
|
|
||||||
.await
|
|
||||||
.log_err(ctx, "Failed marknoticed all chats")
|
|
||||||
.unwrap_or(())
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
fn from_prim<S, T>(s: S) -> Option<T>
|
fn from_prim<S, T>(s: S) -> Option<T>
|
||||||
where
|
where
|
||||||
T: FromPrimitive,
|
T: FromPrimitive,
|
||||||
|
|||||||
29
src/chat.rs
29
src/chat.rs
@@ -1800,35 +1800,6 @@ pub async fn marknoticed_chat(context: &Context, chat_id: ChatId) -> Result<(),
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn marknoticed_all_chats(context: &Context) -> Result<(), Error> {
|
|
||||||
if !context
|
|
||||||
.sql
|
|
||||||
.exists(
|
|
||||||
"SELECT id
|
|
||||||
FROM msgs
|
|
||||||
WHERE state=10;",
|
|
||||||
paramsv![],
|
|
||||||
)
|
|
||||||
.await?
|
|
||||||
{
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
|
|
||||||
context
|
|
||||||
.sql
|
|
||||||
.execute(
|
|
||||||
"UPDATE msgs
|
|
||||||
SET state=13
|
|
||||||
WHERE state=10;",
|
|
||||||
paramsv![],
|
|
||||||
)
|
|
||||||
.await?;
|
|
||||||
|
|
||||||
context.emit_event(EventType::MsgsNoticed(ChatId::new(0)));
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn get_chat_media(
|
pub async fn get_chat_media(
|
||||||
context: &Context,
|
context: &Context,
|
||||||
chat_id: ChatId,
|
chat_id: ChatId,
|
||||||
|
|||||||
Reference in New Issue
Block a user