Repository navigation
上架插件:老师消息通知 (com.jingh.teacher-notifier) - #208
Open
jinghengsun wants to merge 3 commits into
Open
jinghengsun wants to merge 3 commits into
jinghengsun wants to merge 3 commits into
Conversation
jinghengsun
force-pushed
the
add-com.jingh.teacher-notifier
branch
from
October 3, 2026 15:34
fd973c6 to
600a7d1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
插件信息
com.jingh.teacher-notifier插件简介
通过 NapCat 或 SnowLuma 接收老师 QQ 消息,并在 ClassIsland 上以提醒方式通知。适用于教室电脑挂 ClassIsland、机器人小号接收老师通知的场景。
x-signature(HMAC-SHA1),WebSocket 模式校验Authorization: Bearer <token>。{name}优先显示机器人给老师留的备注,解析链为 手动映射 → 好友列表备注 → 群名片 → 陌生人信息 → 昵称。本次改动
新增
index/plugins-v2/com.jingh.teacher-notifier.yml,清单包含repoOwner/repoName/assetsRoot/artifactName等插件市场所需字段。插件包已在仓库 Release 1.2.0.0 发布,Release 说明中已按规范附带 MD5 校验信息。
版本兼容性说明
插件用
ClassIsland.PluginSdk 2.0.4编译,Avalonia引用锁在11.3.13,因此apiVersion声明为 2.0.0.0。之所以按较低的 2.0.4 而不是最新的 2.1.x 编译:.NET 的程序集绑定要求「运行时版本 ≥ 引用版本」,而 ClassIsland 2.0.4 与 2.1.x 提供的依赖版本并不相同(Avalonia
11.3.13vs11.3.17、DI/Logging 抽象8.0.0.0vs10.0.0.0)。同一个构建在数学上无法同时满足两边,按 2.0.4 编译可以覆盖 2.0.x 与 2.1.x 两个分支。已实测:
1.1.0.0 起修复的问题
1. HTTP 上报鉴权算法错误(会导致完全收不到消息)
原实现按
SHA1(token + body)计算x-signature,而 NapCat(http-client.ts)与 SnowLuma(http-post-adapter.ts)用的都是HMAC-SHA1(key = token, data = body)。只要框架侧配置了 access token,签名校验必然失败、上报被 401 拒绝。现已与两个框架的实现一致。2. 备注获取不到
原实现调用
get_stranger_info,该接口按官方描述是「获取指定非好友用户的信息」,对好友经常返回空备注。现改为从get_friend_list读取好友备注,并按 手动映射 → 好友列表 → 群名片 → 陌生人信息 → 昵称 逐级回退。3. 其他修复
card等字段为null时不再抛异常导致整条消息被丢弃;status/retcode,API 失败不再被静默吞掉;4. 新增 SnowLuma 支持
已核对 SnowLuma 的 OneBot 11 实现与 NapCat 契约一致(同样的 HMAC-SHA1 上报签名、同样的反向 WS
Authorization: Bearer握手),两个框架均可直接使用。同时识别 SnowLuma 的post_type: message_sent,正确忽略机器人自己发送的消息。验证方式
ClassIsland.PluginIndexGenerator1.1.1.0 以-v true在本地校验,插件条目生成成功,DownloadMd5与实际资产 MD5 一致(8b1a403cd6238c85d21cdd9cac04e6a2)。HttpListener+ 模拟 OneBot HTTP API)验证 20 项行为,全部通过,覆盖:正确 HMAC-SHA1 签名被接受、旧的错误签名被 401 拒绝、好友备注优先、昵称/群名片回退、card: null不丢消息、自消息过滤、空结果不缓存。自查
a.b.c.d格式(1.2.0.0).cipx插件包资产,且包内 manifest 与索引清单一致ClassIsland.PluginIndexGenerator在本地校验通过