Skip to content
Permalink
Browse files

Add configurable cap to visible channel list

In the config under [UI] set MaxUserlistSize. A negative number will
disable the cap, otherwise no more than the set number of users will be
added to the visible list. The internal Channel.Users() list is not
affected. The default is set to 255 (the new Blizzard cap).
  • Loading branch information...
Davnit committed Apr 27, 2018
1 parent 83d33be commit 7f041563beaad32b3f4910c70c90f9f15f42f00e
Showing with 15 additions and 0 deletions.
  1. +12 −0 trunk/clsConfig.cls
  2. +3 −0 trunk/frmChat.frm
@@ -172,6 +172,7 @@ Private m_DisableRTBAutoCopy As Boolean
Private m_HideBanMessages As Boolean
Private m_NameAutoComplete As Boolean
Private m_RealmHideMotd As Boolean
Private m_MaxUserlistSize As Integer

'[UI-POSITION]
Private m_PositionLeft As Long
@@ -1204,6 +1205,14 @@ Public Property Let RealmHideMotd(ByVal sValue As Boolean)
m_RealmHideMotd = sValue
End Property

Public Property Get MaxUserlistSize() As Integer
MaxUserlistSize = m_MaxUserlistSize
End Property

Public Property Let MaxUserlistSize(ByVal iValue As Integer)
m_MaxUserlistSize = iValue
End Property


'-------------------------
' SECTION: UI-POSITION
@@ -1880,6 +1889,7 @@ Public Sub Save(Optional ByVal sFilePath As String = vbNullString)
WriteSetting SECTION_UI, "NoRTBAutomaticCopy", m_DisableRTBAutoCopy
WriteSetting SECTION_UI, "HideBanMessages", m_HideBanMessages
WriteSetting SECTION_UI, "RealmHideMotd", m_RealmHideMotd
WriteSetting SECTION_UI, "MaxUserlistSize", m_MaxUserlistSize

WriteSetting SECTION_UI_POS, "Left", m_PositionLeft
WriteSetting SECTION_UI_POS, "Top", m_PositionTop
@@ -2082,6 +2092,7 @@ Private Sub LoadDefaults()
m_DisableRTBAutoCopy = False
m_HideBanMessages = False
m_RealmHideMotd = False
m_MaxUserlistSize = 255

'[UI-Position]
m_PositionLeft = 0
@@ -2434,6 +2445,7 @@ Private Sub LoadVersion6Config()
m_DisableRTBAutoCopy = ReadSettingB(SECTION_UI, "NoRTBAutomaticCopy", m_DisableRTBAutoCopy)
m_HideBanMessages = ReadSettingB(SECTION_UI, "HideBanMessages", m_HideBanMessages)
m_RealmHideMotd = ReadSettingB(SECTION_UI, "RealmHideMotd", m_RealmHideMotd)
m_MaxUserlistSize = ReadSettingL(SECTION_UI, "MaxUserlistSize", m_MaxUserlistSize)

m_PositionLeft = ReadSettingL(SECTION_UI_POS, "Left", m_PositionLeft)
m_PositionTop = ReadSettingL(SECTION_UI_POS, "Top", m_PositionTop)
@@ -8181,6 +8181,9 @@ Public Sub AddName(ByVal UserObj As clsUserObj, Optional ByVal OldPosition As In
IsSelf = True
End If

' Only add items if we are under the limit.
If ((Config.MaxUserlistSize > -1) And (lvChannel.ListItems.Count >= Config.MaxUserlistSize)) Then Exit Sub

'If (GetChannelItemIndex(Username) > 0) Then
' Exit Sub
'End If

0 comments on commit 7f04156

Please sign in to comment.
You can’t perform that action at this time.