Prefer direct copies for playback, saves and exports within verified device groups
This commit is contained in:
@@ -14,6 +14,10 @@ export function createDirectRelay({ now = Date.now } = {}) {
|
||||
const r = rate && t - rate.start < 60000 ? rate : { start: t, count: 0 };
|
||||
rates.set(from, r);
|
||||
if (++r.count > 240) return false;
|
||||
if (m.action === 'request') {
|
||||
if (m.to === from || !peers.has(m.to)) return false;
|
||||
send(peers.get(m.to), { type: 'direct', action: 'request', from, id: m.id }); return true;
|
||||
}
|
||||
if (m.action === 'invite') {
|
||||
if (m.to === from || !peers.has(m.to) || transfers.size >= 64) return false;
|
||||
const token = randomBytes(24).toString('base64url');
|
||||
|
||||
Reference in New Issue
Block a user