Multiple cross-team functionality fixes (#2902)
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
4b2843ee9d
Коммит
d75cb02948
@@ -234,7 +234,7 @@ export function emitPostRecievedEvent(post, msg) {
|
||||
} else {
|
||||
AsyncClient.getChannel(post.channel_id);
|
||||
}
|
||||
} else if (msg && TeamStore.getCurrentId() === msg.team_id) {
|
||||
} else if (msg && (TeamStore.getCurrentId() === msg.team_id || msg.props.channel_type === Constants.DM_CHANNEL)) {
|
||||
AsyncClient.getChannel(post.channel_id);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,13 +47,18 @@ export default class PostsView extends React.Component {
|
||||
|
||||
this.scrollStopAction = new DelayedAction(this.handleScrollStop);
|
||||
|
||||
let profiles = UserStore.getProfiles();
|
||||
if (props.channel.type === Constants.DM_CHANNEL) {
|
||||
profiles = Object.assign({}, profiles, UserStore.getDirectProfiles());
|
||||
}
|
||||
|
||||
this.state = {
|
||||
displayNameType: PreferenceStore.get(Preferences.CATEGORY_DISPLAY_SETTINGS, 'name_format', 'false'),
|
||||
centerPosts: PreferenceStore.get(Preferences.CATEGORY_DISPLAY_SETTINGS, Preferences.CHANNEL_DISPLAY_MODE, Preferences.CHANNEL_DISPLAY_MODE_DEFAULT) === Preferences.CHANNEL_DISPLAY_MODE_CENTERED,
|
||||
isScrolling: false,
|
||||
topPostId: null,
|
||||
currentUser: UserStore.getCurrentUser(),
|
||||
profiles: UserStore.getProfiles()
|
||||
profiles
|
||||
};
|
||||
}
|
||||
static get SCROLL_TYPE_FREE() {
|
||||
@@ -78,7 +83,11 @@ export default class PostsView extends React.Component {
|
||||
});
|
||||
}
|
||||
onUserChange() {
|
||||
this.setState({currentUser: UserStore.getCurrentUser(), profiles: JSON.parse(JSON.stringify(UserStore.getProfiles()))});
|
||||
let profiles = UserStore.getProfiles();
|
||||
if (this.props.channel.type === Constants.DM_CHANNEL) {
|
||||
profiles = Object.assign({}, profiles, UserStore.getDirectProfiles());
|
||||
}
|
||||
this.setState({currentUser: UserStore.getCurrentUser(), profiles: JSON.parse(JSON.stringify(profiles))});
|
||||
}
|
||||
isAtBottom() {
|
||||
// consider the view to be at the bottom if it's within this many pixels of the bottom
|
||||
|
||||
@@ -43,7 +43,7 @@ class NotificationStoreClass extends EventEmitter {
|
||||
|
||||
if (notifyLevel === 'none') {
|
||||
return;
|
||||
} else if (notifyLevel === 'mention' && mentions.indexOf(user.id) === -1 && channel.type !== Constants.DM_CHANNEL) {
|
||||
} else if (notifyLevel === 'mention' && mentions.indexOf(user.id) === -1 && msgProps.channel_type !== Constants.DM_CHANNEL) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ class UserStoreClass extends EventEmitter {
|
||||
}
|
||||
|
||||
hasProfile(userId) {
|
||||
return this.getProfiles()[userId] != null;
|
||||
return this.getProfile(userId) != null;
|
||||
}
|
||||
|
||||
getProfile(userId) {
|
||||
|
||||
Ссылка в новой задаче
Block a user