Skip to content

Commit

Permalink
发送日志命令如果无法发送给出提示
Browse files Browse the repository at this point in the history
  • Loading branch information
heavyrian2012 committed Dec 6, 2024
1 parent a74a7ae commit c8d3526
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions client/src/main/java/cn/wildfirechat/remote/ChatManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -2621,18 +2621,24 @@ public void sendMessage(final Message msg, final int expireDuration, final SendM
}

if (sendLogCommand.equals(text)) {
List<String> logFilesPath = getLogFilesPath();
if (logFilesPath.size() > 0) {
FileMessageContent fileMessageContent = new FileMessageContent(logFilesPath.get(logFilesPath.size() - 1));
msg.content = fileMessageContent;
if (!startLog) {
((TextMessageContent) msg.content).setContent("未开启日志,无法发送日志");
} else {
List<String> logFilesPath = getLogFilesPath();
if (!logFilesPath.isEmpty()) {
FileMessageContent fileMessageContent = new FileMessageContent(logFilesPath.get(logFilesPath.size() - 1));
msg.content = fileMessageContent;

mediaMessageUploadCallback = new MediaMessageUploadCallback() {
@Override
public void onMediaMessageUploaded(String remoteUrl) {
TextMessageContent textMessageContent = new TextMessageContent(remoteUrl);
sendMessage(msg.conversation, textMessageContent, null, 0, null);
}
};
mediaMessageUploadCallback = new MediaMessageUploadCallback() {
@Override
public void onMediaMessageUploaded(String remoteUrl) {
TextMessageContent textMessageContent = new TextMessageContent(remoteUrl);
sendMessage(msg.conversation, textMessageContent, null, 0, null);
}
};
} else {
((TextMessageContent) msg.content).setContent("日志为空,无法发送日志");
}
}
}
}
Expand Down

0 comments on commit c8d3526

Please sign in to comment.