Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
add teams chats selectors boilerplate
Browse files Browse the repository at this point in the history
standard boilerplate additions, largely copy-paste and renamed from other files.
  • Loading branch information
ryanfkeepers committed Jan 19, 2024
1 parent 07997b0 commit 0a6355e
Show file tree
Hide file tree
Showing 7 changed files with 1,374 additions and 5 deletions.
File renamed without changes.
8 changes: 4 additions & 4 deletions src/pkg/selectors/exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ func (ec exchangeCategory) isLeaf() bool {
// pathValues transforms the two paths to maps of identified properties.
//
// Example:
// [tenantID, service, userPN, category, mailFolder, mailID]
// [tenantID, service, userID, category, mailFolder, mailID]
// => {exchMailFolder: mailFolder, exchMail: mailID}
func (ec exchangeCategory) pathValues(
repo path.Path,
Expand Down Expand Up @@ -772,7 +772,7 @@ func (s ExchangeScope) matchesInfo(dii details.ItemInfo) bool {

infoCat := s.InfoCategory()

cfpc := categoryFromItemType(info.ItemType)
cfpc := exchangeCategoryFromItemType(info.ItemType)
if !typeAndCategoryMatches(infoCat, cfpc) {
return false
}
Expand Down Expand Up @@ -801,10 +801,10 @@ func (s ExchangeScope) matchesInfo(dii details.ItemInfo) bool {
return s.Matches(infoCat, i)
}

// categoryFromItemType interprets the category represented by the ExchangeInfo
// exchangeCategoryFromItemType interprets the category represented by the ExchangeInfo
// struct. Since every ExchangeInfo can hold all exchange data info, the exact
// type that the struct represents must be compared using its ItemType prop.
func categoryFromItemType(pct details.ItemType) exchangeCategory {
func exchangeCategoryFromItemType(pct details.ItemType) exchangeCategory {
switch pct {
case details.ExchangeContact:
return ExchangeContact
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/selectors/exchange_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1602,7 +1602,7 @@ func (suite *ExchangeSelectorSuite) TestCategoryFromItemType() {
suite.Run(test.name, func() {
t := suite.T()

result := categoryFromItemType(test.input)
result := exchangeCategoryFromItemType(test.input)
assert.Equal(t, test.expect, result)
})
}
Expand Down
2 changes: 2 additions & 0 deletions src/pkg/selectors/selectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const (
ServiceOneDrive service = 2 // OneDrive
ServiceSharePoint service = 3 // SharePoint
ServiceGroups service = 4 // Groups
ServiceTeamsChats service = 5 // TeamsChats
)

var serviceToPathType = map[service]path.ServiceType{
Expand All @@ -34,6 +35,7 @@ var serviceToPathType = map[service]path.ServiceType{
ServiceOneDrive: path.OneDriveService,
ServiceSharePoint: path.SharePointService,
ServiceGroups: path.GroupsService,
ServiceTeamsChats: path.TeamsChatsService,
}

var (
Expand Down
Loading

0 comments on commit 0a6355e

Please sign in to comment.