1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2024-11-26 10:52:16 -05:00

Server: getCurrentChannelNames()

This commit is contained in:
Sebastian Kaspari 2010-04-13 21:55:25 +02:00
parent 4062f0b16e
commit f3a3afcd13

View File

@ -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
*