Changeset 482 in code for trunk/upstream.go
- Timestamp:
- Mar 29, 2021, 2:55:57 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/upstream.go
r480 r482 1741 1741 } 1742 1742 1743 detached := false1744 if ch := uc.network.channels.Value(entity); ch != nil {1745 detached = ch.Detached1746 }1747 1748 1743 delivered := uc.network.delivered.Value(entity) 1749 1744 entityCM := uc.network.casemap(entity) 1750 1745 if delivered == nil { 1746 // This is the first message we receive from this target. Save the last 1747 // message ID in delivery receipts, so that we can send the new message 1748 // in the backlog if an offline client reconnects. 1751 1749 lastID, err := uc.user.msgStore.LastMsgID(uc.network, entityCM, time.Now()) 1752 1750 if err != nil { … … 1758 1756 uc.network.delivered.SetValue(entity, delivered) 1759 1757 1760 for clientName, _ := range uc.network. offlineClients {1758 for clientName, _ := range uc.network.clients { 1761 1759 delivered[clientName] = lastID 1762 }1763 1764 if detached {1765 // If the channel is detached, online clients act as offline1766 // clients too1767 uc.forEachDownstream(func(dc *downstreamConn) {1768 delivered[dc.clientName] = lastID1769 })1770 1760 } 1771 1761 }
Note:
See TracChangeset
for help on using the changeset viewer.