Compare commits
No commits in common. "bb9b92230ba02fc8ee9636cd70f385ca961461b7" and "2e1a3037b6c967605b84ec308f52dc75dfc1e37f" have entirely different histories.
bb9b92230b
...
2e1a3037b6
@ -146,7 +146,6 @@ class _SCMessageChatPageState extends State<SCMessageChatPage> {
|
||||
SocialChatUserProfile? friend;
|
||||
SCVipResourceRes? _selfVipChatBubble;
|
||||
bool _isSelfVipChatBubbleLoading = false;
|
||||
final Map<String, _CpInviteMessageState> _localCpInviteStates = {};
|
||||
|
||||
///是否显示发送按钮
|
||||
bool showSend = false;
|
||||
@ -603,8 +602,6 @@ class _SCMessageChatPageState extends State<SCMessageChatPage> {
|
||||
currentConversationMessageList[i].sender == "administrator",
|
||||
friend: friend,
|
||||
currentConversationMessageList: currentConversationMessageList,
|
||||
localCpInviteStates: _localCpInviteStates,
|
||||
onCpInviteStateChanged: _setLocalCpInviteState,
|
||||
updateCall: () {
|
||||
setState(() {});
|
||||
},
|
||||
@ -617,17 +614,6 @@ class _SCMessageChatPageState extends State<SCMessageChatPage> {
|
||||
);
|
||||
}
|
||||
|
||||
void _setLocalCpInviteState(String applyId, _CpInviteMessageState state) {
|
||||
final normalizedApplyId = applyId.trim();
|
||||
if (normalizedApplyId.isEmpty) {
|
||||
return;
|
||||
}
|
||||
_localCpInviteStates[normalizedApplyId] = state;
|
||||
if (mounted) {
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
|
||||
List<V2TimMessage> _messagesInDisplayOrder(List<V2TimMessage> messages) {
|
||||
final indexedMessages = messages.asMap().entries.toList();
|
||||
indexedMessages.sort((left, right) {
|
||||
@ -1191,9 +1177,6 @@ class _MessageItem extends StatelessWidget {
|
||||
final SocialChatUserProfile? friend;
|
||||
bool isSystem = false;
|
||||
List<V2TimMessage> currentConversationMessageList = [];
|
||||
final Map<String, _CpInviteMessageState> localCpInviteStates;
|
||||
final void Function(String applyId, _CpInviteMessageState state)?
|
||||
onCpInviteStateChanged;
|
||||
Function updateCall;
|
||||
|
||||
///上一条
|
||||
@ -1207,8 +1190,6 @@ class _MessageItem extends StatelessWidget {
|
||||
// this.userProfile,
|
||||
this.isSystem = false,
|
||||
required this.currentConversationMessageList,
|
||||
this.localCpInviteStates = const {},
|
||||
this.onCpInviteStateChanged,
|
||||
this.friend,
|
||||
required this.updateCall,
|
||||
});
|
||||
@ -1545,7 +1526,7 @@ class _MessageItem extends StatelessWidget {
|
||||
if (data == null || !_isCpInvitePayload(data)) {
|
||||
return null;
|
||||
}
|
||||
if (_cpInviteStateForMessage(data) != _CpInviteMessageState.accepted) {
|
||||
if (_cpInviteStateFromData(data) != _CpInviteMessageState.accepted) {
|
||||
return null;
|
||||
}
|
||||
final cpInvite = _cpInviteFromMessageData(data);
|
||||
@ -1686,7 +1667,7 @@ class _MessageItem extends StatelessWidget {
|
||||
if (data == null || !_isCpInvitePayload(data)) {
|
||||
return null;
|
||||
}
|
||||
final state = _cpInviteStateForMessage(data);
|
||||
final state = _cpInviteStateFromData(data);
|
||||
if (state == _CpInviteMessageState.pending) {
|
||||
return null;
|
||||
}
|
||||
@ -1941,10 +1922,6 @@ class _MessageItem extends StatelessWidget {
|
||||
return;
|
||||
}
|
||||
SmartDialog.dismiss(tag: RoomCpInviteDialog.dialogTag);
|
||||
onCpInviteStateChanged?.call(
|
||||
applyId,
|
||||
agree ? _CpInviteMessageState.accepted : _CpInviteMessageState.rejected,
|
||||
);
|
||||
_cpMessageLog(
|
||||
'process submitted applyId=$applyId agree=$agree '
|
||||
'wait_backend_result=true',
|
||||
@ -2032,10 +2009,6 @@ class _MessageItem extends StatelessWidget {
|
||||
}
|
||||
|
||||
_CpInviteMessageState _cpInviteStateForMessage(Map<String, dynamic> data) {
|
||||
final localState = _localCpInviteStateForData(data);
|
||||
if (localState != null) {
|
||||
return localState;
|
||||
}
|
||||
final explicitState = _cpInviteStateFromConversation(data);
|
||||
if (explicitState != _CpInviteMessageState.pending) {
|
||||
return explicitState;
|
||||
@ -2049,10 +2022,6 @@ class _MessageItem extends StatelessWidget {
|
||||
Map<String, dynamic> currentData,
|
||||
) {
|
||||
final applyId = _cpApplyIdFromData(currentData);
|
||||
final localState = _localCpInviteStateForApplyId(applyId);
|
||||
if (localState != null) {
|
||||
return localState;
|
||||
}
|
||||
final currentState = _cpInviteStateFromData(currentData);
|
||||
if (currentState != _CpInviteMessageState.pending || applyId.isEmpty) {
|
||||
return currentState;
|
||||
@ -2074,18 +2043,6 @@ class _MessageItem extends StatelessWidget {
|
||||
return _CpInviteMessageState.pending;
|
||||
}
|
||||
|
||||
_CpInviteMessageState? _localCpInviteStateForData(Map<String, dynamic> data) {
|
||||
return _localCpInviteStateForApplyId(_cpApplyIdFromData(data));
|
||||
}
|
||||
|
||||
_CpInviteMessageState? _localCpInviteStateForApplyId(String applyId) {
|
||||
final normalizedApplyId = applyId.trim();
|
||||
if (normalizedApplyId.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
return localCpInviteStates[normalizedApplyId];
|
||||
}
|
||||
|
||||
bool _isDuplicateCpInviteMessageForConversation(Map<String, dynamic> data) {
|
||||
final currentKey = _cpInviteMessageDedupKey(data);
|
||||
if (currentKey.isEmpty) {
|
||||
@ -2129,7 +2086,7 @@ class _MessageItem extends StatelessWidget {
|
||||
if (!_isCpInvitePayload(data)) {
|
||||
return "";
|
||||
}
|
||||
final state = _cpInviteStateForMessage(data);
|
||||
final state = _cpInviteStateFromData(data);
|
||||
final applyId = _cpApplyIdFromData(data);
|
||||
if (applyId.isEmpty) {
|
||||
return "";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user