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

Update user permissions when room power levels change, or when they accept an invitation to a room #305

Merged
merged 17 commits into from
Dec 31, 2024

Conversation

aaravlu
Copy link
Contributor

@aaravlu aaravlu commented Dec 27, 2024

Fixes #302

@aaravlu aaravlu marked this pull request as ready for review December 27, 2024 12:00
@aaravlu aaravlu changed the title Permissions are not updated in a timely manner after successfully accepting an invitation to a direct room Permissions are not updated in a timely manner after successfully accepting an invitation to a room Dec 27, 2024
@aaravlu
Copy link
Contributor Author

aaravlu commented Dec 27, 2024

Screencast.from.2024-12-27.19-56-49.webm

@aaravlu aaravlu added the waiting-on-review This issue is waiting to be reviewed label Dec 27, 2024
@aaravlu aaravlu requested a review from kevinaboos December 27, 2024 13:01
@kevinaboos
Copy link
Member

kevinaboos commented Dec 27, 2024

Screencast.from.2024-12-27.19-56-49.webm

looks like things still don't work? i can't quite tell what this screen recording is trying to show.... it looks like you join a room but then it still shows that you don't have permissions to send a message?

it also looks like your changes broke the latest event code, since many of the rooms say [Loading latest message]

Copy link
Member

@kevinaboos kevinaboos left a comment

Choose a reason for hiding this comment

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

Based on your screen recording, i think this PR accidentally breaks the latest_event calculation code.

Instead of this new approach where you separate out avatar handling from "can send message" handling, please move it all into a single update_latest_event() function (like i had before), which will ensure that all of the various possible relevant event kinds are handled upon every change to the latest event (which can occur in multiple places). I think the following 5 things are of interest to us:

  • room name
  • room avatar
  • room power levels
  • membership change
  • latest event text preview

src/sliding_sync.rs Outdated Show resolved Hide resolved
src/sliding_sync.rs Outdated Show resolved Hide resolved
@kevinaboos kevinaboos added waiting-on-author This issue is waiting on the original author for a response and removed waiting-on-review This issue is waiting to be reviewed labels Dec 27, 2024
@aaravlu
Copy link
Contributor Author

aaravlu commented Dec 28, 2024

looks like things still don't work?

It works. I apologize for not clarifying the screenshot.

I have already used account aaravlu to set room 302 send permission to 100 so that account demolemon cannot send message in the room, and then aaravlu invited demolemon to this room.
It directly show the cannot send notice in demolemon's screen after accepting the invitation without reselecting room 302 manually.

@kevinaboos
Copy link
Member

looks like things still don't work?

It works. I apologize for not clarifying the screenshot.

I have already used account aaravlu to set room 302 send permission to 100 so that account demolemon cannot send message in the room, and then aaravlu invited demolemon to this room. It directly show the cannot send notice in demolemon's screen after accepting the invitation without reselecting room 302 manually.

oh i see, that makes more sense then. It appeared to be the opposite. Thanks for clarifying

@aaravlu aaravlu added waiting-on-review This issue is waiting to be reviewed and removed waiting-on-author This issue is waiting on the original author for a response labels Dec 28, 2024
@aaravlu aaravlu requested a review from kevinaboos December 28, 2024 03:44
Copy link
Member

@kevinaboos kevinaboos left a comment

Choose a reason for hiding this comment

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

Getting closer, but you missed some of what I said here:

Instead of this new approach where you separate out avatar handling from "can send message" handling, please move it all into a single update_latest_event() function (like i had before), which will ensure that all of the various possible relevant event kinds are handled upon every change to the latest event (which can occur in multiple places). I think the following 5 things are of interest to us:

  • room name
  • room avatar
  • room power levels
  • membership change
  • latest event text preview

src/sliding_sync.rs Outdated Show resolved Hide resolved
src/sliding_sync.rs Show resolved Hide resolved
@kevinaboos kevinaboos changed the title Permissions are not updated in a timely manner after successfully accepting an invitation to a room Update user permissions when room power levels change, or when they accept an invitation to a room Dec 30, 2024
@kevinaboos kevinaboos added waiting-on-author This issue is waiting on the original author for a response and removed waiting-on-review This issue is waiting to be reviewed labels Dec 30, 2024
@aaravlu
Copy link
Contributor Author

aaravlu commented Dec 30, 2024

Getting closer, but you missed some

Yeah. now they are in one function.
We currently handle room name, avatar, membership and power levels changes.
Lmk if there's anything else you want.

@aaravlu aaravlu added waiting-on-review This issue is waiting to be reviewed and removed waiting-on-author This issue is waiting on the original author for a response labels Dec 30, 2024
@aaravlu aaravlu requested a review from kevinaboos December 30, 2024 05:59
Copy link
Member

@kevinaboos kevinaboos left a comment

Choose a reason for hiding this comment

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

Looks good now! Thanks for your great work here!

@kevinaboos kevinaboos merged commit 87b97e9 into project-robius:main Dec 31, 2024
3 checks passed
@kevinaboos kevinaboos removed the waiting-on-review This issue is waiting to be reviewed label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants