friendschat: remove user count

this widget is gone, we can find a new place for it in the future maybe
This commit is contained in:
Max Weber
2021-05-18 13:24:47 -06:00
parent e588635ccc
commit 1cf90b4feb

View File

@@ -284,27 +284,16 @@ public class FriendsChatPlugin extends Plugin
return; return;
} }
Widget chatTitleWidget = client.getWidget(WidgetInfo.FRIENDS_CHAT_TITLE); Widget chatList = client.getWidget(WidgetInfo.FRIENDS_CHAT_LIST);
if (chatTitleWidget != null) if (chatList != null)
{ {
Widget chatList = client.getWidget(WidgetInfo.FRIENDS_CHAT_LIST);
Widget owner = client.getWidget(WidgetInfo.FRIENDS_CHAT_OWNER); Widget owner = client.getWidget(WidgetInfo.FRIENDS_CHAT_OWNER);
FriendsChatManager friendsChatManager = client.getFriendsChatManager(); FriendsChatManager friendsChatManager = client.getFriendsChatManager();
if (friendsChatManager != null && friendsChatManager.getCount() > 0) if ((friendsChatManager == null || friendsChatManager.getCount() <= 0)
&& chatList.getChildren() == null && !Strings.isNullOrEmpty(owner.getText())
&& config.recentChats())
{ {
chatTitleWidget.setText(TITLE + " (" + friendsChatManager.getCount() + "/100)"); loadFriendsChats();
}
else if (chatList.getChildren() == null && !Strings.isNullOrEmpty(owner.getText()))
{
if (config.recentChats())
{
chatTitleWidget.setText(RECENT_TITLE);
loadFriendsChats();
}
else
{
chatTitleWidget.setText(TITLE);
}
} }
} }
@@ -605,7 +594,6 @@ public class FriendsChatPlugin extends Plugin
private void resetChats() private void resetChats()
{ {
Widget chatList = client.getWidget(WidgetInfo.FRIENDS_CHAT_LIST); Widget chatList = client.getWidget(WidgetInfo.FRIENDS_CHAT_LIST);
Widget chatTitleWidget = client.getWidget(WidgetInfo.FRIENDS_CHAT_TITLE);
if (chatList == null) if (chatList == null)
{ {
@@ -617,8 +605,6 @@ public class FriendsChatPlugin extends Plugin
{ {
chatList.setChildren(null); chatList.setChildren(null);
} }
chatTitleWidget.setText(TITLE);
} }
private void loadFriendsChats() private void loadFriendsChats()