adapt repl to new videochat api

This commit is contained in:
B. Petersen
2020-07-20 14:36:06 +02:00
parent 29d4197340
commit 4227dec127
2 changed files with 7 additions and 1 deletions

View File

@@ -359,6 +359,7 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu
send-garbage\n\ send-garbage\n\
sendimage <file> [<text>]\n\ sendimage <file> [<text>]\n\
sendfile <file> [<text>]\n\ sendfile <file> [<text>]\n\
videochat\n\
draft [<text>]\n\ draft [<text>]\n\
devicemsg <text>\n\ devicemsg <text>\n\
listmedia\n\ listmedia\n\
@@ -808,6 +809,10 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu
} }
chat::send_msg(&context, sel_chat.as_ref().unwrap().get_id(), &mut msg).await?; chat::send_msg(&context, sel_chat.as_ref().unwrap().get_id(), &mut msg).await?;
} }
"videochat" => {
ensure!(sel_chat.is_some(), "No chat selected.");
chat::send_videochat_invitation(&context, sel_chat.as_ref().unwrap().get_id()).await?;
}
"listmsgs" => { "listmsgs" => {
ensure!(!arg1.is_empty(), "Argument <query> missing."); ensure!(!arg1.is_empty(), "Argument <query> missing.");

View File

@@ -158,7 +158,7 @@ const DB_COMMANDS: [&str; 9] = [
"housekeeping", "housekeeping",
]; ];
const CHAT_COMMANDS: [&str; 26] = [ const CHAT_COMMANDS: [&str; 27] = [
"listchats", "listchats",
"listarchived", "listarchived",
"chat", "chat",
@@ -178,6 +178,7 @@ const CHAT_COMMANDS: [&str; 26] = [
"send", "send",
"sendimage", "sendimage",
"sendfile", "sendfile",
"videochat",
"draft", "draft",
"listmedia", "listmedia",
"archive", "archive",