Skip to content

Commit de38b41

Browse files
authored
doc: Two JsonRPC doc improvements (#6778)
1 parent 21010f4 commit de38b41

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

deltachat-jsonrpc/src/api.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2276,6 +2276,37 @@ impl CommandApi {
22762276

22772277
// mimics the old desktop call, will get replaced with something better in the composer rewrite,
22782278
// the better version will just be sending the current draft, though there will be probably something similar with more options to this for the corner cases like setting a marker on the map
2279+
/// Send a message to a chat.
2280+
///
2281+
/// This function returns after the message has been placed in the sending queue.
2282+
/// This does not imply that the message was really sent out yet.
2283+
/// However, from your view, you're done with the message.
2284+
/// Sooner or later it will find its way.
2285+
///
2286+
/// **Attaching files:**
2287+
///
2288+
/// Pass the file path in the `file` parameter.
2289+
/// If `file` is not in the blob directory yet,
2290+
/// it will be copied into the blob directory.
2291+
/// If you want, you can delete the file immediately after this function returns.
2292+
///
2293+
/// You can also write the attachment directly into the blob directory
2294+
/// and then pass the path as the `file` parameter;
2295+
/// this will prevent an unnecessary copying of the file.
2296+
///
2297+
/// In `filename`, you can pass the original name of the file,
2298+
/// which will then be shown in the UI.
2299+
/// in this case the current name of `file` on the filesystem will be ignored.
2300+
///
2301+
/// In order to deduplicate files that contain the same data,
2302+
/// the file will be named `<hash>.<extension>`, e.g. `ce940175885d7b78f7b7e9f1396611f.jpg`.
2303+
///
2304+
/// NOTE:
2305+
/// - This function will rename the file. To get the new file path, call `get_file()`.
2306+
/// - The file must not be modified after this function was called.
2307+
/// - Images etc. will NOT be recoded.
2308+
/// In order to recode images,
2309+
/// use `misc_set_draft` and pass `Image` as the viewtype.
22792310
#[expect(clippy::too_many_arguments)]
22802311
async fn misc_send_msg(
22812312
&self,

deltachat-jsonrpc/src/api/types/login_param.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ use serde::Serialize;
55
use yerpc::TypeDef;
66

77
/// Login parameters entered by the user.
8-
8+
///
9+
/// Usually it will be enough to only set `addr` and `password`,
10+
/// and all the other settings will be autoconfigured.
911
#[derive(Serialize, Deserialize, TypeDef, schemars::JsonSchema)]
1012
#[serde(rename_all = "camelCase")]
1113
pub struct EnteredLoginParam {

0 commit comments

Comments
 (0)