removed outdated "flag" comments on clientapi membership storage (#566)

Signed-off-by: Derek Meer <derekmeer@protonmail.com>
main
Derek 2018-07-31 02:06:04 -07:00 committed by Erik Johnston
parent 2a2f42990a
commit f8ca2561cc
1 changed files with 7 additions and 12 deletions

View File

@ -143,9 +143,8 @@ func (d *Database) CreateAccount(
} }
// SaveMembership saves the user matching a given localpart as a member of a given // SaveMembership saves the user matching a given localpart as a member of a given
// room. It also stores the ID of the membership event and a flag on whether the user // room. It also stores the ID of the membership event.
// is still in the room. // If a membership already exists between the user and the room, or if the
// If a membership already exists between the user and the room, or of the
// insert fails, returns the SQL error // insert fails, returns the SQL error
func (d *Database) saveMembership( func (d *Database) saveMembership(
ctx context.Context, txn *sql.Tx, localpart, roomID, eventID string, ctx context.Context, txn *sql.Tx, localpart, roomID, eventID string,
@ -153,8 +152,8 @@ func (d *Database) saveMembership(
return d.memberships.insertMembership(ctx, txn, localpart, roomID, eventID) return d.memberships.insertMembership(ctx, txn, localpart, roomID, eventID)
} }
// removeMembershipsByEventIDs removes the memberships of which the `join` membership // removeMembershipsByEventIDs removes the memberships corresponding to the
// event ID is included in a given array of events IDs // `join` membership events IDs in the eventIDs slice.
// If the removal fails, or if there is no membership to remove, returns an error // If the removal fails, or if there is no membership to remove, returns an error
func (d *Database) removeMembershipsByEventIDs( func (d *Database) removeMembershipsByEventIDs(
ctx context.Context, txn *sql.Tx, eventIDs []string, ctx context.Context, txn *sql.Tx, eventIDs []string,
@ -205,13 +204,9 @@ func (d *Database) GetMembershipsByLocalpart(
return d.memberships.selectMembershipsByLocalpart(ctx, localpart) return d.memberships.selectMembershipsByLocalpart(ctx, localpart)
} }
// newMembership will save a new membership in the database, with a flag on whether // newMembership saves a new membership in the database.
// the user is still in the room. This flag is set to true if the given state // If the event isn't a valid m.room.member event with type `join`, does nothing.
// event is a "join" membership event and false if the event is a "leave" or "ban" // If an error occurred, returns the SQL error
// membership. If the event isn't a m.room.member event with one of these three
// values, does nothing.
// If the event isn't a "join" membership event, does nothing
// If an error occurred, returns it
func (d *Database) newMembership( func (d *Database) newMembership(
ctx context.Context, txn *sql.Tx, ev gomatrixserverlib.Event, ctx context.Context, txn *sql.Tx, ev gomatrixserverlib.Event,
) error { ) error {