Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/jupyter-chat/src/components/chat-messages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,10 @@ export const ChatMessage = forwardRef<HTMLDivElement, ChatMessageProps>(
if (model.user.username === message.sender.username) {
setCanEdit(model.updateMessage !== undefined);
setCanDelete(model.deleteMessage !== undefined);
return;
}
if (message.sender.bot) {
setCanDelete(model.deleteMessage !== undefined);
}
} else {
setCanEdit(false);
Expand Down
4 changes: 4 additions & 0 deletions packages/jupyter-chat/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ export interface IUser {
* The string to use to mention a user in the chat.
*/
mention_name?: string;
/**
* Boolean identifying if user is a bot.
*/
bot?: boolean;
}

/**
Expand Down
3 changes: 3 additions & 0 deletions python/jupyterlab-chat/jupyterlab_chat/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ class User(JupyterUser):
mention_name: Optional[str] = None
""" The string to use as mention in chat """

bot: Optional[bool] = None
""" Boolean identifying if user is a bot """


@dataclass
class Attachment:
Expand Down
Loading