media: add fallbacks for a couple more types
Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
This commit is contained in:
@@ -96,14 +96,21 @@ func (mc *MessageConverter) ToMatrix(ctx context.Context, portal *bridgev2.Porta
|
|||||||
cm.Parts = append(cm.Parts, mc.convertDice(media))
|
cm.Parts = append(cm.Parts, mc.convertDice(media))
|
||||||
case tg.MessageMediaGameTypeID:
|
case tg.MessageMediaGameTypeID:
|
||||||
cm.Parts = append(cm.Parts, mc.convertGame(media))
|
cm.Parts = append(cm.Parts, mc.convertGame(media))
|
||||||
// case tg.MessageMediaStoryTypeID:
|
|
||||||
// cm.Parts = append(cm.Parts, mc.convertStory(media))
|
|
||||||
// case tg.MessageMediaInvoiceTypeID:
|
|
||||||
// cm.Parts = append(cm.Parts, mc.convertInvoice(media))
|
|
||||||
|
|
||||||
// TODO
|
case tg.MessageMediaStoryTypeID, tg.MessageMediaInvoiceTypeID, tg.MessageMediaGiveawayTypeID, tg.MessageMediaGiveawayResultsTypeID:
|
||||||
// case tg.MessageMediaGiveawayTypeID:
|
// TODO: support these properly
|
||||||
// case tg.MessageMediaGiveawayResultsTypeID:
|
cm.Parts = append(cm.Parts, &bridgev2.ConvertedMessagePart{
|
||||||
|
ID: networkid.PartID("story"),
|
||||||
|
Type: event.EventMessage,
|
||||||
|
Content: &event.MessageEventContent{
|
||||||
|
MsgType: event.MsgNotice,
|
||||||
|
Body: fmt.Sprintf("%s are not yet supported. Open Telegram to view.", media.TypeName()),
|
||||||
|
},
|
||||||
|
Extra: map[string]any{
|
||||||
|
"fi.mau.telegram.unsupported": true,
|
||||||
|
"fi.mau.telegram.type_id": media.TypeID(),
|
||||||
|
},
|
||||||
|
})
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("unsupported media type %T", media)
|
return nil, fmt.Errorf("unsupported media type %T", media)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user