mattermost-community / mattermost-plugin-jitsi

Jitsi plugin for Mattermost :electric_plug:
Apache License 2.0
197 stars 90 forks source link

Command responses don't get posted in the RHS #153

Closed hanzei closed 2 years ago

hanzei commented 4 years ago

Running a slash command in the RHS should post the response there.

See https://github.com/mattermost/mattermost-plugin-github/issues/364 for a similar bug.

tw-ayush commented 4 years ago

hey can you elaborate a little more on the issue?

hanzei commented 4 years ago

Sure. If a user runs e.g. /jitsi help in a tread in the Right Hand Site, the response will be posted in the center channel. This ticket is about changing the behaviour to also post in the RHS.

tw-ayush commented 4 years ago

Apologies if i'm getting into too much details here... but can you tell me which of these parameters needs to be added in the request?

type Post struct {
    Id         string `json:"id"`
    CreateAt   int64  `json:"create_at"`
    UpdateAt   int64  `json:"update_at"`
    EditAt     int64  `json:"edit_at"`
    DeleteAt   int64  `json:"delete_at"`
    IsPinned   bool   `json:"is_pinned"`
    UserId     string `json:"user_id"`
    ChannelId  string `json:"channel_id"`
    RootId     string `json:"root_id"`
    ParentId   string `json:"parent_id"`
    OriginalId string `json:"original_id"`

    Message string `json:"message"`
    // MessageSource will contain the message as submitted by the user if Message has been modified
    // by Mattermost for presentation (e.g if an image proxy is being used). It should be used to
    // populate edit boxes if present.
    MessageSource string `json:"message_source,omitempty" db:"-"`

    Type          string          `json:"type"`
    propsMu       sync.RWMutex    `db:"-"`       // Unexported mutex used to guard Post.Props.
    Props         StringInterface `json:"props"` // Deprecated: use GetProps()
    Hashtags      string          `json:"hashtags"`
    Filenames     StringArray     `json:"filenames,omitempty"` // Deprecated, do not use this field any more
    FileIds       StringArray     `json:"file_ids,omitempty"`
    PendingPostId string          `json:"pending_post_id" db:"-"`
    HasReactions  bool            `json:"has_reactions,omitempty"`

    // Transient data populated before sending a post to the client
    ReplyCount int64         `json:"reply_count" db:"-"`
    Metadata   *PostMetadata `json:"metadata,omitempty" db:"-"`
}
hanzei commented 4 years ago

No problem @tw-ayush. Feel free to ask any questions you need to work on this ticket.

RootId is the field that controls to which thread a post it tied to.