Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

feat: ✨ add ability to reply with text messages #89

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

HarHarLinks
Copy link
Contributor

@HarHarLinks HarHarLinks commented Nov 27, 2021

I did refactor send_markdown_message along the way because it is almost identical to send_text_message and code reply and other would be doubled up otherwise. This should improve maintainability while staying compatible with earlier versions.

Sending replies isn't so bad, but receiving and reading replies correctly is a harder problem. I think it is reasonable to just not go there and wait for MSC2781 matrix-org/matrix-spec-proposals#2781 to arrive at which point the issue would be resolved.

I also revised the manual to reflect the changes.

Demo:
image

await bot.api.send_text_message(
room_id=room.room_id,
message=example_message,
reply_to=message)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think calling the received event "message" might be confusing here, since the parameter is also called message and the text is example_message. Perhaps rename it to event?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renaming it to either event_content or message_content would probably be better. I think that event would be confusing.

Copy link
Contributor Author

@HarHarLinks HarHarLinks Nov 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not content though, it's the actual nio.events.room_events.RoomMessage object, isn't it?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. What about content_body?

@HarHarLinks HarHarLinks changed the title add ability to reply with text messages feature: ✨ add ability to reply with text messages Dec 1, 2021
@HarHarLinks HarHarLinks changed the title feature: ✨ add ability to reply with text messages feat: ✨ add ability to reply with text messages Dec 1, 2021
@ghost ghost added the Long Term Something that is not expected to be resolved soon label Dec 24, 2021
@ghost ghost force-pushed the master branch 2 times, most recently from a711bef to e95148d Compare December 29, 2021 17:51
@cutec-chris
Copy link

is there an chance that this could be merged ?

@ghost
Copy link

ghost commented Apr 8, 2022

We are waiting on MSC2781 matrix-org/matrix-spec-proposals#2781

@HarHarLinks
Copy link
Contributor Author

HarHarLinks commented Jul 30, 2022

We are waiting on MSC2781 matrix-org/matrix-spec-proposals#2781

@imbev: MSC3676 which starts fading out reply fallbacks has been merged and element has partially start dropping them as well (e.g. you can now reply with files etc. and you can send anything you want inside of threads).

@imbev
Copy link
Owner

imbev commented Jul 30, 2022

@imbev
Copy link
Owner

imbev commented Jul 30, 2022

The implementation in this branch does not match the current spec.

Current branch:

content["m.relates.to"] = {"m.in_reply_to": {"event_id": reply_to.event_id}}

Spec

{
  "m.relates_to": {
    "event_id": "$an_event",
    "rel_type": "org.example.relationship"
  }
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Long Term Something that is not expected to be resolved soon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants