Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add messageReplyOption to endpoint to support threaded replies #73

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

alexandermarston
Copy link
Contributor

No description provided.

@mr-karan mr-karan merged commit b3a5468 into mr-karan:main Feb 22, 2024
@mr-karan
Copy link
Owner

This looks useful. Thanks!

@alexandermarston
Copy link
Contributor Author

Thanks @mr-karan - would you mind cutting a release with this?

@alexandermarston alexandermarston deleted the messageReplyOption branch February 22, 2024 09:01
@mr-karan
Copy link
Owner

@jonathan-correa-paiva
Copy link

jonathan-correa-paiva commented Mar 5, 2024

Threaded replays needs to have a threadKey to send the same alert to the same "conversation", Maybe you could use the fingerprint to manage threadKeys, because, in a Room cnveted to conversarions, generates a new Thread every in every notification.

image

Instead of sending the thread name, it's needs to send a threadKey in the thread object.

Maybe I need to do another config or something, but I've implemented the same in jenkins and I needed to change the object of thread to threadKey: "newKey" in this case we could use the fingerprint.

image

In Jenkins I've made a random string for a job to have all the messages in the same conversation.

I hope I explained it correctly.

When using REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD and threadKey the response changes.

$ curl -X POST -H "Content-Type: application/json" "https://chat.googleapis.com/v1/spaces/AAAAVRbTs0I/messages?key=ofuscatedI&token=ofuscated&messageReplyOption=REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD" -d '{"text": "One\nTwo\nThree", "thread": {"threadKey": "7EWOnlFbT"}}'

///// Response

{
  "name": "spaces/ofuscated/messages/ofuscated.ofuscated",
  "sender": {
    "name": "users/ofuscated",
    "displayName": "Prueab",
    "type": "BOT"
  },
  "createTime": "2024-03-05T02:40:47.890255Z",
  "text": "One\nTwo\nThree",
  "thread": {
    "name": "spaces/ofuscated/threads/ofuscated",
    "retentionSettings": {
      "state": "PERMANENT"
    },
    "threadKey": "7EWOnlFbT" //// The same to use the same conversation.
  },
  "space": {
    "name": "spaces/ofuscated",
    "type": "ROOM",
    "displayName": "Clipboard",
    "spaceThreadingState": "THREADED_MESSAGES",
    "spaceType": "SPACE",
    "spaceHistoryState": "HISTORY_ON",
    "createTime": "2020-05-04T18:50:46.017816Z"
  },
  "argumentText": "One\nTwo\nThree",
  "threadReply": true,
  "retentionSettings": {
    "state": "PERMANENT"
  },
  "formattedText": "One\nTwo\nThree"
}

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants