Skip to content

Commit

Permalink
优化消息记录中的多行消息
Browse files Browse the repository at this point in the history
  • Loading branch information
iwxyi committed Jul 23, 2021
1 parent 72461dd commit 73387d9
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,39 @@



## 详细说明

### 消息重要性

本程序中每个用户、群组,都有自己的聊天重要性,即优先级。

有如下四级:

- 很重要
- 重要(私聊默认)
- 一般(群聊默认)
- 不重要

在右下角的托盘菜单中,可以设置允许通知的重要性,低于该重要性的消息不会显示通知。



### 不超时消失

**很重要**” 级别的通知卡片,将会一直悬浮在屏幕上,不会主动超时消失(默认7秒钟后隐藏)。

设置中也可手动开启,针对私聊、群聊进行整体设置。

卡片中的右键菜单关闭、鼠标划过均可隐藏卡片。



### 发送图片

在程序根目录下,有 `catlike_server` 文件夹,需要放到**开启了 PHP 服务的网站目录**下,设置中将该文件夹的访问路径填入“服务主机”设置项中,即可拖拽图片到悬浮通知上,快速发送图片、表情包。



## 常见问题

### 消息发送失败,账号可能被风控?
Expand Down
7 changes: 5 additions & 2 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,13 @@ void MainWindow::showHistoryListMenu()

headerLabel->setPixmap(pixmap.isNull() ? QPixmap("://icons/ignore") : pixmap);
titleLabel->setText(name);
QString mess = MessageView::simpleMessage(msg);
if (mess.contains("\n"))
mess = mess.left(mess.indexOf("\n"));
if (msg.isPrivate())
messageLabel->setText(MessageView::simpleMessage(msg));
messageLabel->setText(mess);
else
messageLabel->setText(msg.nickname + ": " + MessageView::simpleMessage(msg));
messageLabel->setText(msg.nickname + ": " + mess);
titleLabel->setMaximumWidth(us->bannerFixedWidth);
messageLabel->setMaximumWidth(us->bannerFixedWidth);
headerLabel->setScaledContents(true);
Expand Down
2 changes: 1 addition & 1 deletion notification/messageview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void MessageView::setMessage(const MsgBean& msg)
this->msg = msg;
QString text = msg.message;
if (msg.isPrivate() && msg.senderId == ac->myId)
text.insert(0, ":");
text.insert(0, "");
QRegularExpression re;
QRegularExpressionMatch match;

Expand Down
2 changes: 1 addition & 1 deletion widgets/settings/applicationwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void ApplicationWidget::on_startOnPowerOnCheck_clicked()
QSettings *reg=new QSettings("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", QSettings::NativeFormat);
QString val = reg->value(appName).toString();// 如果此键不存在,则返回的是空字符串
if (us->startOnPowerOn)
reg->setValue(appName, appPath);// 如果移除的话
reg->setValue(appName, appPath);
else
reg->remove(appName);
reg->deleteLater();
Expand Down

0 comments on commit 73387d9

Please sign in to comment.