Merge pull request #2394 from urbit/mp/os1/chat/contact-polling

chat: pull room contacts from associated group
This commit is contained in:
Logan 2020-03-03 18:33:20 -08:00 committed by GitHub
commit f457c0e568
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,12 +45,13 @@ export class Root extends Component {
state.invites['/chat'] : {}; state.invites['/chat'] : {};
let contacts = !!state.contacts ? state.contacts : {}; let contacts = !!state.contacts ? state.contacts : {};
let associations = !!state.associations ? state.associations : new Map;
const renderChannelSidebar = (props, station) => ( const renderChannelSidebar = (props, station) => (
<Sidebar <Sidebar
inbox={state.inbox} inbox={state.inbox}
messagePreviews={messagePreviews} messagePreviews={messagePreviews}
associations={state.associations || new Map} associations={associations}
contacts={contacts} contacts={contacts}
invites={invites} invites={invites}
unreads={unreads} unreads={unreads}
@ -152,8 +153,14 @@ export class Root extends Component {
envelopes: [] envelopes: []
}; };
let roomContacts = (station in contacts) let roomContacts = {};
? contacts[station] : {}; let associatedGroup = ((associations.has(station)) &&
(associations.get(station)["group-path"]))
? associations.get(station)["group-path"] : "";
if ((associations.has(station)) && (associatedGroup in contacts)) {
roomContacts = contacts[associatedGroup]
}
let group = state.groups[station] || new Set([]); let group = state.groups[station] || new Set([]);
let popout = props.match.url.includes("/popout/"); let popout = props.match.url.includes("/popout/");
@ -240,9 +247,8 @@ export class Root extends Component {
let popout = props.match.url.includes("/popout/"); let popout = props.match.url.includes("/popout/");
let association = ((state.associations) && let association = (associations.has(station))
(state.associations.has(station))) ? associations.get(station) : {};
? state.associations.get(station) : {};
return ( return (
<Skeleton <Skeleton