mirror of
https://github.com/moparisthebest/Yaaic
synced 2024-11-26 19:02:17 -05:00
Server: getCurrentChannelNames()
This commit is contained in:
parent
4062f0b16e
commit
f3a3afcd13
@ -20,6 +20,7 @@ along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.yaaic.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
@ -304,6 +305,25 @@ public class Server
|
||||
return selected;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get names of the currently joined channels
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String[] getCurrentChannelNames()
|
||||
{
|
||||
ArrayList<String> channels = new ArrayList<String>();
|
||||
Collection<Conversation> mConversations = conversations.values();
|
||||
|
||||
for (Conversation conversation : mConversations) {
|
||||
if (conversation.getType() == Conversation.TYPE_CHANNEL) {
|
||||
channels.add(conversation.getName());
|
||||
}
|
||||
}
|
||||
|
||||
return (String[]) channels.toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get icon for current server status
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user