Skip to content

Commit

Permalink
can receive files in user contact,
Browse files Browse the repository at this point in the history
but have a problem:
<wechaty#84>
  • Loading branch information
林宇靖 committed Jul 24, 2021
1 parent ab7c9e1 commit 86e830d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/appservice-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,11 @@ export class AppserviceManager extends Manager {
switch (message.type()) {
case MessageType.Unknown:
break
case MessageType.Attachment:
break
case MessageType.Audio:
break
case MessageType.Contact: // image in ipad protocol is Emoticon
break
case MessageType.Emoticon: case MessageType.Image:
case MessageType.Emoticon: case MessageType.Image: case MessageType.Attachment:
// image in web protocol is Image, in ipad protocol is Emoticon
try {
const file = await message.toFileBox()
Expand All @@ -154,9 +152,9 @@ export class AppserviceManager extends Manager {
await intent.sendMessage(
inRoom.getId(),
{
body: 'Image',
body: file.name,
info: {},
msgtype: 'm.image',
msgtype: message.type() === MessageType.Attachment ? 'm.file' : 'm.image',
url: url,
}
)
Expand Down

0 comments on commit 86e830d

Please sign in to comment.