|
@@ -2583,6 +2583,9 @@ func (portal *Portal) uploadMedia(intent *appservice.IntentAPI, data []byte, con
|
|
|
|
|
|
func (portal *Portal) convertMediaMessage(intent *appservice.IntentAPI, source *User, info *types.MessageInfo, msg MediaMessage, typeName string, isBackfill bool) *ConvertedMessage {
|
|
|
converted := portal.convertMediaMessageContent(intent, msg)
|
|
|
+ if msg.GetFileLength() > uint64(portal.bridge.MediaConfig.UploadSize) {
|
|
|
+ return portal.makeMediaBridgeFailureMessage(info, errors.New("file is too large"), converted, nil, fmt.Sprintf("Large %s not bridged - please use WhatsApp app to view", typeName))
|
|
|
+ }
|
|
|
data, err := source.Client.Download(msg)
|
|
|
if errors.Is(err, whatsmeow.ErrMediaDownloadFailedWith404) || errors.Is(err, whatsmeow.ErrMediaDownloadFailedWith410) {
|
|
|
converted.Error = database.MsgErrMediaNotFound
|