aboutsummaryrefslogtreecommitdiffstats
path: root/config/rpc.proto
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2020-01-29 14:33:51 -0800
committerAdam Soltys <[email protected]>2020-01-29 14:33:51 -0800
commitc3ed4317d37f1c760392d9a89610d07ccd3a7d03 (patch)
tree3c73ea9e8ee04c0585a3dce4eb5de5a8f2634100 /config/rpc.proto
parente34f41697eb4b96508dc27197b91ef06bd47a641 (diff)
downloadcoinos-server-c3ed4317d37f1c760392d9a89610d07ccd3a7d03.tar.gz
coinos-server-c3ed4317d37f1c760392d9a89610d07ccd3a7d03.zip
set payment currency
Diffstat (limited to 'config/rpc.proto')
0 files changed, 0 insertions, 0 deletions
.Backtick */ .highlight .sc { color: #D20; background-color: #FFF0F0 } /* Literal.String.Char */ .highlight .dl { color: #D20; background-color: #FFF0F0 } /* Literal.String.Delimiter */ .highlight .sd { color: #D20; background-color: #FFF0F0 } /* Literal.String.Doc */ .highlight .s2 { color: #D20; background-color: #FFF0F0 } /* Literal.String.Double */ .highlight .se { color: #04D; background-color: #FFF0F0 } /* Literal.String.Escape */ .highlight .sh { color: #D20; background-color: #FFF0F0 } /* Literal.String.Heredoc */ .highlight .si { color: #33B; background-color: #FFF0F0 } /* Literal.String.Interpol */ .highlight .sx { color: #2B2; background-color: #F0FFF0 } /* Literal.String.Other */ .highlight .sr { color: #080; background-color: #FFF0FF } /* Literal.String.Regex */ .highlight .s1 { color: #D20; background-color: #FFF0F0 } /* Literal.String.Single */ .highlight .ss { color: #A60; background-color: #FFF0F0 } /* Literal.String.Symbol */ .highlight .bp { color: #038 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #06B; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #369 } /* Name.Variable.Class */ .highlight .vg { color: #D70 } /* Name.Variable.Global */ .highlight .vi { color: #33B } /* Name.Variable.Instance */ .highlight .vm { color: #369 } /* Name.Variable.Magic */ .highlight .il { color: #00D; font-weight: bold } /* Literal.Number.Integer.Long */
// Custom feeds across devices: per feed, the newest edit (`at`) wins, and a
// deletion is remembered (gone: { id: ms }) so a device still holding the
// feed doesn't hand it back. Commutative, so snapshots apply in any order.
// Returns null when the remote copy changes nothing.
export function mergeFeeds(local, remote) {
  const gone = { ...(local.gone || {}) };
  let changed = false;
  for (const [id, t] of Object.entries(remote.gone || {}))
    if (typeof t === 'number' && (gone[id] || 0) < t) { gone[id] = t; changed = true; }
  const feeds = [...(local.feeds || [])];
  const touched = [];
  for (const f of Array.isArray(remote.feeds) ? remote.feeds : []) {
    if (!f || typeof f.id !== 'string' || (gone[f.id] || 0) >= (f.at || 0)) continue;
    const i = feeds.findIndex((x) => x.id === f.id);
    if (i < 0) feeds.push(f);
    else if ((f.at || 0) > (feeds[i].at || 0)) feeds[i] = f;
    else continue;
    touched.push(f.id); changed = true;
  }
  const kept = feeds.filter((f) => (gone[f.id] || 0) < (f.at || 0));
  if (kept.length !== feeds.length) changed = true;
  return changed ? { feeds: kept, gone, touched } : null;
}