mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-12-13 22:00:29 +05:30
Fix for channels with too large name length.
This commit is contained in:
parent
c3863c22b8
commit
0dd97c67ca
@ -76,7 +76,9 @@ public class ChannelHandlers {
|
||||
|
||||
Multithreading.runAsync(() -> {
|
||||
try {
|
||||
MatrixHelper.sendEvent("video.piped.channel.info", new FederatedChannelInfo(info.getId(), info.getName(), info.getAvatarUrl(), info.isVerified()));
|
||||
MatrixHelper.sendEvent("video.piped.channel.info", new FederatedChannelInfo(
|
||||
info.getId(), StringUtils.abbreviate(info.getName(), 100), info.getAvatarUrl(), info.isVerified())
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import jakarta.persistence.criteria.JoinType;
|
||||
import jakarta.persistence.criteria.Root;
|
||||
import me.kavin.piped.consts.Constants;
|
||||
import me.kavin.piped.utils.obj.db.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||
import org.hibernate.SharedSessionContract;
|
||||
import org.hibernate.StatelessSession;
|
||||
@ -191,7 +192,7 @@ public class DatabaseHelper {
|
||||
return null;
|
||||
}
|
||||
|
||||
var channel = new Channel(channelId, info.getName(),
|
||||
var channel = new Channel(channelId, StringUtils.abbreviate(info.getName(), 100),
|
||||
info.getAvatarUrl(), info.isVerified());
|
||||
|
||||
try (StatelessSession s = DatabaseSessionFactory.createStatelessSession()) {
|
||||
|
Loading…
Reference in New Issue
Block a user