Handle duplicate webhooks

This commit is contained in:
2026-01-02 22:41:50 +01:00
parent c7bd24a286
commit 81a8afa332
2 changed files with 31 additions and 15 deletions

View File

@@ -77,7 +77,7 @@ public class WebexService {
}
}
public void post(Message m) throws ServiceException {
public String post(Message m) throws ServiceException {
try (HttpClient client = HttpClient.newHttpClient()) {
Room room = getRoomByClient(m.getClientId());
@@ -91,7 +91,9 @@ public class WebexService {
"text", m.getContent()
);
sendPostRequest(client, "https://webexapis.com/v1/messages", botToken, body);
String response = sendPostRequest(client, "https://webexapis.com/v1/messages", botToken, body);
JsonNode jsonNode = mapper.readTree(response);
return jsonNode.get("id").asText();
} catch (Exception e) {
Logger.displayError(Arrays.toString(e.getStackTrace()));