Changeset 283 in code for trunk


Ignore:
Timestamp:
May 1, 2020, 8:49:58 AM (5 years ago)
Author:
delthas
Message:

Fix joining only one saved channel per network

This fixes a serious bug added in 276ce12e, where in newNetwork all
channels point to the same channel, which causes soju to only join a
single channel when connecting to an upstream network.

This also adds the same kind of reassignment of a for loop variable in
user.run(), even though that function currently works correctly, as a
sanity improvement in case this function is changed in the future.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/user.go

    r279 r283  
    6666        m := make(map[string]*Channel, len(channels))
    6767        for _, ch := range channels {
     68                ch := ch
    6869                m[ch.Name] = &ch
    6970        }
     
    230231
    231232        for _, record := range networks {
     233                record := record
    232234                channels, err := u.srv.db.ListChannels(record.ID)
    233235                if err != nil {
Note: See TracChangeset for help on using the changeset viewer.