parent
609c37cdfe
commit
8475d8d63d
@ -270,7 +270,7 @@ func actionSend(ctx *context.AppContext) {
|
|||||||
// Clear notification icon if there is any
|
// Clear notification icon if there is any
|
||||||
channelItem := ctx.View.Channels.ChannelItems[ctx.View.Channels.SelectedChannel]
|
channelItem := ctx.View.Channels.ChannelItems[ctx.View.Channels.SelectedChannel]
|
||||||
if channelItem.Notification {
|
if channelItem.Notification {
|
||||||
ctx.Service.MarkAsRead(channelItem.ID)
|
ctx.Service.MarkAsRead(channelItem)
|
||||||
ctx.View.Channels.MarkAsRead(ctx.View.Channels.SelectedChannel)
|
ctx.View.Channels.MarkAsRead(ctx.View.Channels.SelectedChannel)
|
||||||
}
|
}
|
||||||
termui.Render(ctx.View.Channels)
|
termui.Render(ctx.View.Channels)
|
||||||
@ -425,7 +425,7 @@ func actionChangeChannel(ctx *context.AppContext) {
|
|||||||
// Clear notification icon if there is any
|
// Clear notification icon if there is any
|
||||||
channelItem := ctx.View.Channels.ChannelItems[ctx.View.Channels.SelectedChannel]
|
channelItem := ctx.View.Channels.ChannelItems[ctx.View.Channels.SelectedChannel]
|
||||||
if channelItem.Notification {
|
if channelItem.Notification {
|
||||||
ctx.Service.MarkAsRead(channelItem.ID)
|
ctx.Service.MarkAsRead(channelItem)
|
||||||
ctx.View.Channels.MarkAsRead(ctx.View.Channels.SelectedChannel)
|
ctx.View.Channels.MarkAsRead(ctx.View.Channels.SelectedChannel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -275,11 +275,29 @@ func (s *SlackService) SetUserAsActive() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MarkAsRead will set the channel as read
|
// MarkAsRead will set the channel as read
|
||||||
func (s *SlackService) MarkAsRead(channelID string) {
|
func (s *SlackService) MarkAsRead(channelItem components.ChannelItem) {
|
||||||
s.Client.SetChannelReadMark(
|
switch channelItem.Type {
|
||||||
channelID, fmt.Sprintf("%f",
|
case components.ChannelTypeChannel:
|
||||||
float64(time.Now().Unix())),
|
s.Client.SetChannelReadMark(
|
||||||
)
|
channelItem.ID, fmt.Sprintf("%f",
|
||||||
|
float64(time.Now().Unix())),
|
||||||
|
)
|
||||||
|
case components.ChannelTypeGroup:
|
||||||
|
s.Client.SetGroupReadMark(
|
||||||
|
channelItem.ID, fmt.Sprintf("%f",
|
||||||
|
float64(time.Now().Unix())),
|
||||||
|
)
|
||||||
|
case components.ChannelTypeMpIM:
|
||||||
|
s.Client.MarkIMChannel(
|
||||||
|
channelItem.ID, fmt.Sprintf("%f",
|
||||||
|
float64(time.Now().Unix())),
|
||||||
|
)
|
||||||
|
case components.ChannelTypeIM:
|
||||||
|
s.Client.MarkIMChannel(
|
||||||
|
channelItem.ID, fmt.Sprintf("%f",
|
||||||
|
float64(time.Now().Unix())),
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// SendMessage will send a message to a particular channel
|
// SendMessage will send a message to a particular channel
|
||||||
|
Loading…
Reference in New Issue
Block a user