Commit d4728d7
authored
feat(square): send image / video / audio to a SquareChat (OpenChat) (#206)
* fix(obs): let uploadObjTalk carry the real audio/video duration
uploadObjTalk hardcoded the obs `duration` param to "1919" for audio and
video. LINE uses this param verbatim as the length shown in the client (it
does not recompute it from the uploaded m4a/mp4), so every voice/video
message was displayed as ~1.9s regardless of its real length. Add an
optional `durationMs` argument and use it, keeping 1919 as the fallback so
existing callers are unaffected.
* feat(square): add SquareChat sendImage/sendVideo/sendAudio helpers
OpenChat rejects the "reserve an empty IMAGE/AUDIO/VIDEO message via sendMessage, then attach the obs object to its id" pattern with ILLEGAL_ARGUMENT. Uploading the obs object with no oid ("reqseq" mode) makes the server create the message itself; a consequence is that such a message can't carry a relatedMessageId, so media sent this way is never threaded as a reply.
Depends on #205 for the durationMs argument that carries the real audio/video length.1 parent 0123866 commit d4728d7
2 files changed
Lines changed: 61 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| 160 | + | |
160 | 161 | | |
161 | 162 | | |
162 | 163 | | |
| |||
195 | 196 | | |
196 | 197 | | |
197 | 198 | | |
198 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
199 | 203 | | |
200 | 204 | | |
201 | 205 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
112 | 168 | | |
113 | 169 | | |
114 | 170 | | |
| |||
0 commit comments