mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-08-14 23:51:41 +00:00
Merge pull request #613 from TeamPiped/channel-length-fix
Fix for channels with too large name length.
This commit is contained in:
commit
8e112d2058
2 changed files with 5 additions and 2 deletions
|
@ -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 a new issue