# Conflicts: # lib/chat/ChatPageItem.dartmaster
@@ -1223,5 +1223,6 @@ | |||||
"man_retranslate":"人工重译", | "man_retranslate":"人工重译", | ||||
"robot_retranslate":"机器重译", | "robot_retranslate":"机器重译", | ||||
"see_original":"查看原文", | "see_original":"查看原文", | ||||
"forward":"Forward" | |||||
"forward":"Forward", | |||||
"copy_download_url":"复制下载地址" | |||||
} | } |
@@ -1223,5 +1223,6 @@ | |||||
"man_retranslate":"人工重译", | "man_retranslate":"人工重译", | ||||
"robot_retranslate":"机器重译", | "robot_retranslate":"机器重译", | ||||
"see_original":"查看原文", | "see_original":"查看原文", | ||||
"forward":"转发" | |||||
"forward":"转发", | |||||
"copy_download_url":"复制下载地址" | |||||
} | } |
@@ -1223,5 +1223,6 @@ | |||||
"man_retranslate":"人工重译", | "man_retranslate":"人工重译", | ||||
"robot_retranslate":"机器重译", | "robot_retranslate":"机器重译", | ||||
"see_original":"查看原文", | "see_original":"查看原文", | ||||
"forward":"转发" | |||||
"forward":"转发", | |||||
"copy_download_url":"复制下载地址" | |||||
} | } |
@@ -1223,5 +1223,6 @@ | |||||
"man_retranslate":"人工重译", | "man_retranslate":"人工重译", | ||||
"robot_retranslate":"机器重译", | "robot_retranslate":"机器重译", | ||||
"see_original":"查看原文", | "see_original":"查看原文", | ||||
"forward":"转发" | |||||
"forward":"转发", | |||||
"copy_download_url":"复制下载地址" | |||||
} | } |
@@ -1223,5 +1223,6 @@ | |||||
"man_retranslate":"人工重译", | "man_retranslate":"人工重译", | ||||
"robot_retranslate":"机器重译", | "robot_retranslate":"机器重译", | ||||
"see_original":"查看原文", | "see_original":"查看原文", | ||||
"forward":"转发" | |||||
"forward":"转发", | |||||
"copy_download_url":"复制下载地址" | |||||
} | } |
@@ -1223,5 +1223,6 @@ | |||||
"man_retranslate":"人工重譯", | "man_retranslate":"人工重譯", | ||||
"robot_retranslate":"機器重譯", | "robot_retranslate":"機器重譯", | ||||
"see_original":"查看原文", | "see_original":"查看原文", | ||||
"forward":"转发" | |||||
"forward":"转发", | |||||
"copy_download_url":"複製下載地址" | |||||
} | } |
@@ -572,11 +572,12 @@ class _GroupChatPageItemState extends State<GroupChatPageItem> | |||||
Widget wrapItemWithMenu(item) { | Widget wrapItemWithMenu(item) { | ||||
List<Function> actionsFunc = []; | List<Function> actionsFunc = []; | ||||
List<String> actions = [I18n.of(context).delete, I18n.of(context).reply,I18n.of(context).forward]; | |||||
List<String> actions = [ | |||||
I18n.of(context).reply, | |||||
I18n.of(context).forward, | |||||
I18n.of(context).delete, | |||||
]; | |||||
actionsFunc.add(() { | |||||
MessageMgr().emit('Delete Select Message', widget.msg); | |||||
}); | |||||
actionsFunc.add(() { | actionsFunc.add(() { | ||||
print('发送引用的消息'); | print('发送引用的消息'); | ||||
MessageMgr().emit('Reply Select Message', widget.msg); | MessageMgr().emit('Reply Select Message', widget.msg); | ||||
@@ -585,6 +586,9 @@ class _GroupChatPageItemState extends State<GroupChatPageItem> | |||||
print('转发消息'); | print('转发消息'); | ||||
AppNavigator.pushForwardPage(context, widget.msg); | AppNavigator.pushForwardPage(context, widget.msg); | ||||
}); | }); | ||||
actionsFunc.add(() { | |||||
MessageMgr().emit('Delete Select Message', widget.msg); | |||||
}); | |||||
@@ -621,6 +625,15 @@ class _GroupChatPageItemState extends State<GroupChatPageItem> | |||||
Clipboard.setData(clipboardData); | Clipboard.setData(clipboardData); | ||||
}); | }); | ||||
} | } | ||||
//如果是文件增加复制下载地址 | |||||
if (widget.msg.msgType == ChatType.FileChatType.value) { | |||||
actions.insert(0, I18n.of(context).copy_download_url); | |||||
actionsFunc.insert(0, () { | |||||
UploadUtil().copyFileUrl(widget.msg, context); | |||||
}); | |||||
} | |||||
if (widget.msg.msgType == ChatType.ShortVoiceChatType.value) { | if (widget.msg.msgType == ChatType.ShortVoiceChatType.value) { | ||||
var soundPlayMode = | var soundPlayMode = | ||||
Provider.of<KeyboardIndexProvider>(context).soundPlayMode; | Provider.of<KeyboardIndexProvider>(context).soundPlayMode; | ||||
@@ -1365,8 +1378,9 @@ class _GroupChatPageItemState extends State<GroupChatPageItem> | |||||
onTap: () { | onTap: () { | ||||
AppNavigator.pushProfileInfoPage(context, memberModel.memberId, | AppNavigator.pushProfileInfoPage(context, memberModel.memberId, | ||||
fromWhere: 2, | fromWhere: 2, | ||||
addMode: | |||||
!FriendListMgr().isMyFriend(memberModel.memberId) ? 1 : 0); | |||||
addMode: !FriendListMgr().isMyFriend(memberModel.memberId) | |||||
? 1 | |||||
: 0); | |||||
}, | }, | ||||
onLongPress: () { | onLongPress: () { | ||||
print('long press user'); | print('long press user'); | ||||
@@ -2483,6 +2483,8 @@ class I18n implements WidgetsLocalizations { | |||||
String get see_original => "查看原文"; | String get see_original => "查看原文"; | ||||
/// "Forward" | /// "Forward" | ||||
String get forward => "Forward"; | String get forward => "Forward"; | ||||
/// "复制下载地址" | |||||
String get copy_download_url => "复制下载地址"; | |||||
} | } | ||||
class _I18n_en_US extends I18n { | class _I18n_en_US extends I18n { | ||||
@@ -6170,6 +6172,9 @@ class _I18n_vi_VN extends I18n { | |||||
/// "转发" | /// "转发" | ||||
@override | @override | ||||
String get forward => "转发"; | String get forward => "转发"; | ||||
/// "复制下载地址" | |||||
@override | |||||
String get copy_download_url => "复制下载地址"; | |||||
@override | @override | ||||
TextDirection get textDirection => TextDirection.ltr; | TextDirection get textDirection => TextDirection.ltr; | ||||
@@ -9853,6 +9858,9 @@ class _I18n_zh_HK extends I18n { | |||||
/// "转发" | /// "转发" | ||||
@override | @override | ||||
String get forward => "转发"; | String get forward => "转发"; | ||||
/// "複製下載地址" | |||||
@override | |||||
String get copy_download_url => "複製下載地址"; | |||||
@override | @override | ||||
TextDirection get textDirection => TextDirection.ltr; | TextDirection get textDirection => TextDirection.ltr; | ||||
@@ -13536,6 +13544,9 @@ class _I18n_zh_CN extends _I18n_zh_HK { | |||||
/// "转发" | /// "转发" | ||||
@override | @override | ||||
String get forward => "转发"; | String get forward => "转发"; | ||||
/// "复制下载地址" | |||||
@override | |||||
String get copy_download_url => "复制下载地址"; | |||||
@override | @override | ||||
TextDirection get textDirection => TextDirection.ltr; | TextDirection get textDirection => TextDirection.ltr; | ||||
@@ -17219,6 +17230,9 @@ class _I18n_ko_KR extends I18n { | |||||
/// "转发" | /// "转发" | ||||
@override | @override | ||||
String get forward => "转发"; | String get forward => "转发"; | ||||
/// "复制下载地址" | |||||
@override | |||||
String get copy_download_url => "复制下载地址"; | |||||
@override | @override | ||||
TextDirection get textDirection => TextDirection.ltr; | TextDirection get textDirection => TextDirection.ltr; | ||||
@@ -20902,6 +20916,9 @@ class _I18n_ja_JP extends I18n { | |||||
/// "转发" | /// "转发" | ||||
@override | @override | ||||
String get forward => "转发"; | String get forward => "转发"; | ||||
/// "复制下载地址" | |||||
@override | |||||
String get copy_download_url => "复制下载地址"; | |||||
@override | @override | ||||
TextDirection get textDirection => TextDirection.ltr; | TextDirection get textDirection => TextDirection.ltr; | ||||
@@ -10,6 +10,8 @@ import 'package:chat/utils/file_cache_mgr.dart'; | |||||
import 'package:convert/convert.dart'; | import 'package:convert/convert.dart'; | ||||
import 'package:dio/dio.dart'; | import 'package:dio/dio.dart'; | ||||
import 'package:crypto/crypto.dart'; | import 'package:crypto/crypto.dart'; | ||||
import 'package:flutter/material.dart'; | |||||
import 'package:flutter/services.dart'; | |||||
import 'dart:async'; | import 'dart:async'; | ||||
import 'package:http_parser/http_parser.dart'; | import 'package:http_parser/http_parser.dart'; | ||||
import 'package:chat/utils/MessageMgr.dart'; | import 'package:chat/utils/MessageMgr.dart'; | ||||
@@ -187,6 +189,13 @@ class UploadUtil { | |||||
'downloadchatfile?targetid=$sessionid&channeltype=$channelType&userid=${UserData().basicInfo.userId}&fileid=$imgData&sign=$sign'; | 'downloadchatfile?targetid=$sessionid&channeltype=$channelType&userid=${UserData().basicInfo.userId}&fileid=$imgData&sign=$sign'; | ||||
} | } | ||||
copyFileUrl(MsgModel msg, BuildContext context) { | |||||
var url = getFullUrl(msg.extraFile, msg.sessionId, msg.channelType); | |||||
ClipboardData clipboardData = new ClipboardData(text: url); | |||||
Clipboard.setData(clipboardData); | |||||
showToast(I18n.of(context).successful_copy); | |||||
} | |||||
Future downloadFile(MsgModel msg, {CancelToken cancelToken}) async { | Future downloadFile(MsgModel msg, {CancelToken cancelToken}) async { | ||||
Response response; | Response response; | ||||