Skip to content

feat: add is_active conversaiton - #212

Open
mchenani wants to merge 6 commits into
mainfrom
mch/libchat-fix-restored-conversations
Open

feat: add is_active conversaiton#212
mchenani wants to merge 6 commits into
mainfrom
mch/libchat-fix-restored-conversations

Conversation

@mchenani

Copy link
Copy Markdown
Contributor

No description provided.

Ok(convos)
}

/// Whether the conversation is loaded and usable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

[?] @jazzz I add this function to check wether we have a specific conversation in the mls client or not, basically what we need is a function to help the devs to determine if the current user can message(if they have that conversation, if they're still a member, or if they have the permission to send message to that conversation) maybe a better naming would be can_message, wdyt?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I love where you head is at - Developer QOL is important.

I think the function makes sense, but I'd want to make sure that its clear to developers about when the function should be used. That would help with determining an appropriate name

The 3 current conditions are:

  • ConversationExists with that Id
  • Still a member
  • Send Permissions
  1. The entry point for retrieving conversation_ids (list_conversations) only returns valid ones.
  2. Currently there is no ability to remove members from a conversation - but this will be needed in the future.
  3. This one is the most unique requirement as some conversations may be read-only (ie broadcasts)

If you really wanted to add this feature pre-emptively I would consider adding can_send(convo_id), can_retrieve(convo_id) filter functions that could be used directly with list_conversations().map(<Filter>)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Definitely, great idea. Will add that in another PR and will use it here.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If this is a painpoint we should check in with developers and get some quick feedback.

[Dust] Assuming we believe that in most cases developers want "sendable" conversations, my default approach would be to:

Change: list_conversations() -> list_all_conversations()
Add: list_sendable_conversations() which performs the mapping reducing work at the callsite.

But I'm not seeing what you are seeing. What direction would you go?

@jazzz jazzz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Theres a pebble that we should sort of a future plan for, else not seeing any blockers.

Changes to client have wider impacts to developers, so lets make sure there is a plan for that.

Comment thread bin/chat-cli/src/app.rs
self.add_system_message(&format!("── Your Chats ({}) ──", sessions.len()));
for s in &sessions {
let active = self.state.active_chat.as_deref() == Some(&s.chat_id);
let read_only = !self.client.has_conversation(&s.chat_id);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[Pebble] As per https://github.com/logos-messaging/libchat/pull/212/changes#r3782651433 we need to be careful here on the public api.

has_conversation implies it returns true if "the conversation exists", however the implementation specifically is focused on whether a developer "can submit new content into the conversation".

These two concepts need to be kept seperate

Ok(convos)
}

/// Whether the conversation is loaded and usable.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If this is a painpoint we should check in with developers and get some quick feedback.

[Dust] Assuming we believe that in most cases developers want "sendable" conversations, my default approach would be to:

Change: list_conversations() -> list_all_conversations()
Add: list_sendable_conversations() which performs the mapping reducing work at the callsite.

But I'm not seeing what you are seeing. What direction would you go?

Base automatically changed from mch/libchat-refactoring-sender-attribution to main August 27, 2026 15:58
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.

2 participants