Skip to content

Commit

Permalink
remove unused opts parameter in adapter.OwnTopics method
Browse files Browse the repository at this point in the history
  • Loading branch information
Googlom committed Oct 23, 2019
1 parent c34bf7a commit bf2f490
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion server/db/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ type Adapter interface {
// UsersForTopic loads users' subscriptions for a given topic. Public is loaded.
UsersForTopic(topic string, keepDeleted bool, opts *t.QueryOpt) ([]t.Subscription, error)
// OwnTopics loads a slice of topic names where the user is the owner.
OwnTopics(uid t.Uid, opts *t.QueryOpt) ([]string, error)
OwnTopics(uid t.Uid) ([]string, error)
// TopicShare creates topc subscriptions
TopicShare(subs []*t.Subscription) (int, error)
// TopicDelete deletes topic, subscription, messages
Expand Down
2 changes: 1 addition & 1 deletion server/db/mysql/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -1387,7 +1387,7 @@ func (a *adapter) UsersForTopic(topic string, keepDeleted bool, opts *t.QueryOpt
}

// OwnTopics loads a slice of topic names where the user is the owner.
func (a *adapter) OwnTopics(uid t.Uid, opts *t.QueryOpt) ([]string, error) {
func (a *adapter) OwnTopics(uid t.Uid) ([]string, error) {
rows, err := a.db.Queryx("SELECT name FROM topics WHERE owner=?", store.DecodeUid(uid))
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion server/db/rethinkdb/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,7 @@ func (a *adapter) UsersForTopic(topic string, keepDeleted bool, opts *t.QueryOpt
}

// OwnTopics loads a slice of topic names where the user is the owner.
func (a *adapter) OwnTopics(uid t.Uid, opts *t.QueryOpt) ([]string, error) {
func (a *adapter) OwnTopics(uid t.Uid) ([]string, error) {
cursor, err := rdb.DB(a.dbName).Table("topics").GetAllByIndex("Owner", uid.String()).
Filter(rdb.Row.HasFields("DeletedAt").Not()).Field("Id").Run(a.conn)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions server/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ func (UsersObjMapper) GetTopicsAny(id types.Uid, opts *types.QueryOpt) ([]types.
}

// GetOwnTopics retuens a slice of group topic names where the user is the owner.
func (UsersObjMapper) GetOwnTopics(id types.Uid, opts *types.QueryOpt) ([]string, error) {
return adp.OwnTopics(id, opts)
func (UsersObjMapper) GetOwnTopics(id types.Uid) ([]string, error) {
return adp.OwnTopics(id)
}

// UpsertCred adds or updates a credential validation request. Return true if the record was inserted, false if updated.
Expand Down
2 changes: 1 addition & 1 deletion server/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ func replyDelUser(s *Session, msg *ClientComMessage) {
}

// Notify subscribers of the group topics where the user was the owner that the topics were deleted.
if ownTopics, err := store.Users.GetOwnTopics(uid, nil); err == nil {
if ownTopics, err := store.Users.GetOwnTopics(uid); err == nil {
for _, topicName := range ownTopics {
if subs, err := store.Topics.GetSubs(topicName, nil); err == nil {
presSubsOfflineOffline(topicName, types.TopicCatGrp, subs, "gone", &presParams{}, s.sid)
Expand Down

0 comments on commit bf2f490

Please sign in to comment.