Merge branch 'refs/heads/master' into develop-1.8.2

This commit is contained in:
jacek.wolniewicz
2024-07-03 23:45:11 +02:00
3 changed files with 54 additions and 33 deletions

View File

@@ -22,16 +22,12 @@
*/
package io.github.jwdeveloper.tiktok.data.models.users;
import io.github.jwdeveloper.tiktok.data.models.badges.Badge;
import io.github.jwdeveloper.tiktok.data.models.Picture;
import io.github.jwdeveloper.tiktok.data.models.badges.Badge;
import io.github.jwdeveloper.tiktok.messages.webcast.*;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.*;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.*;
@Getter
public class User {
@@ -49,12 +45,12 @@ public class User {
return attributes.stream().toList();
}
public boolean hasAttribute(UserAttribute userFlag) {
return attributes.contains(userFlag);
public boolean hasAttribute(UserAttribute attribute) {
return attributes.contains(attribute);
}
public void addAttribute(UserAttribute... flags) {
this.attributes.addAll(Arrays.stream(flags).toList());
public void addAttribute(UserAttribute... attributes) {
this.attributes.addAll(List.of(attributes));
}
public boolean isGiftGiver() {
@@ -168,11 +164,11 @@ public class User {
}
public static User EMPTY = new User(0L,
"",
Picture.empty(),
0,
0,
List.of(Badge.empty()));
"",
Picture.empty(),
0,
0,
List.of(Badge.empty()));
public static User map(io.github.jwdeveloper.tiktok.messages.data.User user) {
return new User(user);
@@ -209,12 +205,12 @@ public class User {
public static User map(WebcastEnvelopeMessage.EnvelopeInfo envelopeInfo) {
return new User(0L,
//envelopeInfo.getSendUserId(),
envelopeInfo.getSendUserName(),
Picture.map(envelopeInfo.getSendUserAvatar()),
0,
0,
List.of(Badge.empty()));
//envelopeInfo.getSendUserId(),
envelopeInfo.getSendUserName(),
Picture.map(envelopeInfo.getSendUserAvatar()),
0,
0,
List.of(Badge.empty()));
}
@Override

View File

@@ -0,0 +1,30 @@
/*
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.jwdeveloper.tiktok.exceptions;
public class TikTokLiveUnknownHostException extends TikTokLiveException
{
public TikTokLiveUnknownHostException(String message) {
super(message);
}
}