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

store IsDefaultConv #21968

Merged
merged 1 commit into from Jan 9, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 12 additions & 11 deletions go/chat/localizer.go
Expand Up @@ -723,17 +723,18 @@ func (s *localizerPipeline) localizeConversation(ctx context.Context, uid gregor
var err error
umapper := s.G().UIDMapper
conversationLocal.Info = chat1.ConversationInfoLocal{
Id: conversationRemote.Metadata.ConversationID,
Visibility: conversationRemote.Metadata.Visibility,
Triple: conversationRemote.Metadata.IdTriple,
Status: conversationRemote.Metadata.Status,
MembersType: conversationRemote.Metadata.MembersType,
MemberStatus: conversationRemote.ReaderInfo.Status,
TeamType: conversationRemote.Metadata.TeamType,
Version: conversationRemote.Metadata.Version,
LocalVersion: conversationRemote.Metadata.LocalVersion,
FinalizeInfo: conversationRemote.Metadata.FinalizeInfo,
Draft: rc.LocalDraft,
Id: conversationRemote.Metadata.ConversationID,
IsDefaultConv: conversationRemote.Metadata.IsDefaultConv,
Visibility: conversationRemote.Metadata.Visibility,
Triple: conversationRemote.Metadata.IdTriple,
Status: conversationRemote.Metadata.Status,
MembersType: conversationRemote.Metadata.MembersType,
MemberStatus: conversationRemote.ReaderInfo.Status,
TeamType: conversationRemote.Metadata.TeamType,
Version: conversationRemote.Metadata.Version,
LocalVersion: conversationRemote.Metadata.LocalVersion,
FinalizeInfo: conversationRemote.Metadata.FinalizeInfo,
Draft: rc.LocalDraft,
}
conversationLocal.BotAliases = make(map[string]string)
conversationLocal.BotCommands = chat1.NewConversationCommandGroupsWithNone()
Expand Down
2 changes: 1 addition & 1 deletion go/chat/storage/inbox.go
Expand Up @@ -22,7 +22,7 @@ import (
"golang.org/x/net/context"
)

const inboxVersion = 27
const inboxVersion = 28

var defaultMemberStatusFilter = []chat1.ConversationMemberStatus{
chat1.ConversationMemberStatus_ACTIVE,
Expand Down
3 changes: 3 additions & 0 deletions go/chat/utils/utils.go
Expand Up @@ -1274,6 +1274,7 @@ func PresentRemoteConversation(ctx context.Context, g *globals.Context, rc types
res.TlfID = rawConv.Metadata.IdTriple.Tlfid.String()
res.TopicType = rawConv.GetTopicType()
res.IsPublic = rawConv.Metadata.Visibility == keybase1.TLFVisibility_PUBLIC
res.IsDefaultConv = rawConv.Metadata.IsDefaultConv
res.Name = tlfName
res.Status = rawConv.Metadata.Status
res.Time = GetConvMtime(rc)
Expand Down Expand Up @@ -1393,6 +1394,7 @@ func PresentConversationLocal(ctx context.Context, g *globals.Context, uid grego
res.TlfID = rawConv.Info.Triple.Tlfid.String()
res.TopicType = rawConv.GetTopicType()
res.IsPublic = rawConv.Info.Visibility == keybase1.TLFVisibility_PUBLIC
res.IsDefaultConv = rawConv.Info.IsDefaultConv
res.Name = rawConv.Info.TlfName
res.SnippetDecoration, res.Snippet = GetConvSnippet(rawConv, g.GetEnv().GetUsername().String())
res.Channel = rawConv.Info.TopicName
Expand Down Expand Up @@ -2711,6 +2713,7 @@ func DBConvLess(a pager.InboxEntry, b pager.InboxEntry) bool {

func ExportToSummary(i chat1.InboxUIItem) (s chat1.ConvSummary) {
s.Id = i.ConvID
s.IsDefaultConv = i.IsDefaultConv
s.Unread = i.ReadMsgID < i.MaxVisibleMsgID
s.ActiveAt = i.Time.UnixSeconds()
s.ActiveAtMs = i.Time.UnixMilliseconds()
Expand Down
36 changes: 19 additions & 17 deletions go/protocol/chat1/api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 14 additions & 10 deletions go/protocol/chat1/chat_ui.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 29 additions & 27 deletions go/protocol/chat1/local.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions protocol/avdl/chat1/api.avdl
Expand Up @@ -206,6 +206,8 @@ protocol api {
string id;
@jsonkey("channel")
ChatChannel channel;
@jsonkey("is_default_conv")
boolean isDefaultConv;
@jsonkey("unread")
boolean unread;
@jsonkey("active_at")
Expand Down
2 changes: 2 additions & 0 deletions protocol/avdl/chat1/chat_ui.avdl
Expand Up @@ -79,6 +79,7 @@ protocol chatUi {
string tlfID;
TopicType topicType;
boolean isPublic;
boolean isDefaultConv;
string name;
keybase1.TLFVisibility visibility;
ConversationStatus status;
Expand Down Expand Up @@ -135,6 +136,7 @@ protocol chatUi {
TopicType topicType;
boolean isPublic;
boolean isEmpty;
boolean isDefaultConv;
string name;
string snippet;
SnippetDecoration snippetDecoration;
Expand Down
1 change: 1 addition & 0 deletions protocol/avdl/chat1/local.avdl
Expand Up @@ -592,6 +592,7 @@ protocol local {
union { null, ConversationPinnedMessage } pinnedMsg;
union { null, string } draft;
keybase1.TLFVisibility visibility;
boolean isDefaultConv;
ConversationStatus status;
ConversationMembersType membersType;
ConversationMemberStatus memberStatus;
Expand Down
5 changes: 5 additions & 0 deletions protocol/json/chat1/api.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions protocol/json/chat1/chat_ui.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions protocol/json/chat1/local.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.