mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
移除可以与同一用户创建多个会话的特性
This commit is contained in:
1 parent
d04628148f
commit
3c5fdb9032
16 files changed
+120
-118
No files matched your search
@@ -56,7 +56,7 @@ export default class MessagePadDialogueContentContainer extends React.PureCompon
|
||||
return _.map(this.props.item.reply, (reply, idx) => (
|
||||
<Message
|
||||
key={idx}
|
||||
isSelf={reply.from === UserContext.uid}
|
||||
isSelf={reply.from === UserContext._id}
|
||||
faceUrl={
|
||||
reply.from === this.props.item.from
|
||||
? this.props.item.from_udoc.gravatar_url
|
||||
|
||||
@@ -39,7 +39,7 @@ export default class MessagePadDialogueListContainer extends React.PureComponent
|
||||
<ListItem
|
||||
key={dialogue._id}
|
||||
userName={
|
||||
dialogue.from === UserContext.uid
|
||||
dialogue.from === UserContext._id
|
||||
? dialogue.to_udoc.uname
|
||||
: dialogue.from_udoc.uname
|
||||
}
|
||||
@@ -49,7 +49,7 @@ export default class MessagePadDialogueListContainer extends React.PureComponent
|
||||
: _.last(dialogue.reply).content
|
||||
}
|
||||
faceUrl={
|
||||
dialogue.from === UserContext.uid
|
||||
dialogue.from === UserContext._id
|
||||
? dialogue.to_udoc.gravatar_url
|
||||
: dialogue.from_udoc.gravatar_url
|
||||
}
|
||||
|
||||
@@ -18,9 +18,7 @@ const mapStateToProps = (state) => ({
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
handleChange(id, value) {
|
||||
if (id === null) {
|
||||
return;
|
||||
}
|
||||
if (id === null) return;
|
||||
dispatch({
|
||||
type: 'DIALOGUES_INPUT_CHANGED',
|
||||
payload: value,
|
||||
@@ -30,11 +28,9 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
});
|
||||
},
|
||||
postSend(placeholderId, uid, value) {
|
||||
if (placeholderId === null) {
|
||||
return;
|
||||
}
|
||||
if (placeholderId === null) return;
|
||||
const req = request.post('', {
|
||||
operation: 'send_message',
|
||||
operation: 'send',
|
||||
uid,
|
||||
content: value,
|
||||
});
|
||||
@@ -46,20 +42,19 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
},
|
||||
});
|
||||
},
|
||||
postReply(id, value) {
|
||||
if (id === null) {
|
||||
return;
|
||||
}
|
||||
postReply(_id, uid, value) {
|
||||
if (_id === null) return;
|
||||
const req = request.post('', {
|
||||
operation: 'reply_message',
|
||||
message_id: id,
|
||||
operation: 'send',
|
||||
type: 'single',
|
||||
uid,
|
||||
content: value,
|
||||
});
|
||||
dispatch({
|
||||
type: 'DIALOGUES_POST_REPLY',
|
||||
payload: req,
|
||||
meta: {
|
||||
dialogueId: id,
|
||||
dialogueId: _id,
|
||||
},
|
||||
});
|
||||
},
|
||||
@@ -103,6 +98,7 @@ export default class MessagePadInputContainer extends React.PureComponent {
|
||||
} else {
|
||||
this.props.postReply(
|
||||
this.props.activeId,
|
||||
state.dialogues[this.props.activeId].to,
|
||||
this.props.inputValue,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ export default function reducer(state = {}, action) {
|
||||
...state,
|
||||
[id]: {
|
||||
_id: id,
|
||||
from: UserContext.uid,
|
||||
from: UserContext._id,
|
||||
to: user._id,
|
||||
to_udoc: { ...user },
|
||||
reply: [],
|
||||
|
||||
Reference in new issue
Block a user