Skip to content

armgit / meet

Public Imported from GitHub
0

Open source video conferencing app powered by LiveKit. Built with Django and React.

♻️(addons) insert meeting link at the cursor position

lebaudantoinef1fce4431f90
diff --git a/src/addons/outlook/src/commands/commands.js b/src/addons/outlook/src/commands/commands.js
index d369431b..09480d33 100644
--- a/src/addons/outlook/src/commands/commands.js
+++ b/src/addons/outlook/src/commands/commands.js
@@ -30,35 +30,26 @@ function insertMeetingLink(event, session) {
const coercionType = isWeb ? Office.CoercionType.Html : Office.CoercionType.Text;
return new Promise((resolve, reject) => {
- item.body.getAsync(coercionType, (getResult) => {
- if (getResult.status !== Office.AsyncResultStatus.Succeeded) {
- notify(`Erreur de lecture : ${getResult.error.message}`);
+ item.body.setSelectedDataAsync(text, { coercionType }, (setResult) => {
+ if (setResult.status !== Office.AsyncResultStatus.Succeeded) {
+ notify(`Erreur d'insertion : ${setResult.error.message}`);
resolve();
return;
}
- item.body.setAsync(
- getResult.value + text,
- { coercionType: coercionType }, (setResult) => {
- if (setResult.status !== Office.AsyncResultStatus.Succeeded) {
- notify(`Erreur d'insertion : ${setResult.error.message}`);
- resolve();
- return;
- }
- if (item.itemType !== Office.MailboxEnums.ItemType.Appointment) {
+ if (item.itemType !== Office.MailboxEnums.ItemType.Appointment) {
+ notify("Lien de réunion inséré !");
+ resolve();
+ return;
+ }
+
+ item.location.setAsync(url, (locationResult) => {
+ if (locationResult.status !== Office.AsyncResultStatus.Succeeded) {
+ notify(`Erreur de localisation : ${locationResult.error.message}`);
+ } else {
notify("Lien de réunion inséré !");
- resolve();
- return;
}
-
- item.location.setAsync(url, (locationResult) => {
- if (locationResult.status !== Office.AsyncResultStatus.Succeeded) {
- notify(`Erreur de localisation : ${locationResult.error.message}`);
- } else {
- notify("Lien de réunion inséré !");
- }
- resolve();
- });
+ resolve();
});
});
});
diff --git a/src/addons/outlook/src/taskpane/taskpane.js b/src/addons/outlook/src/taskpane/taskpane.js
index a0541e51..77c22007 100644
--- a/src/addons/outlook/src/taskpane/taskpane.js
+++ b/src/addons/outlook/src/taskpane/taskpane.js
@@ -77,29 +77,17 @@ function generateMeetingLink() {
const coercionType = isWeb ? Office.CoercionType.Html : Office.CoercionType.Text;
return new Promise((resolve, reject) => {
- item.body.getAsync(coercionType, (getResult) => {
- if (getResult.status !== Office.AsyncResultStatus.Succeeded) {
- reject(getResult.error);
+ item.body.setSelectedDataAsync(text, { coercionType }, (setResult) => {
+ if (setResult.status !== Office.AsyncResultStatus.Succeeded) {
+ reject(setResult.error);
return;
}
- item.body.setAsync(
- getResult.value + text,
- { coercionType: coercionType },
- (setResult) => {
- if (setResult.status !== Office.AsyncResultStatus.Succeeded) {
- reject(setResult.error);
- return;
- }
-
- // ─── If calendar event, also set location ──────────────
- if (item.itemType === Office.MailboxEnums.ItemType.Appointment) {
- item.location.setAsync(url, () => resolve());
- return;
- }
-
- resolve();
- }
- );
+ // ─── If calendar event, also set location ──────────────
+ if (item.itemType === Office.MailboxEnums.ItemType.Appointment) {
+ item.location.setAsync(url, () => resolve());
+ return;
+ }
+ resolve();
});
});
})