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

Ignore case of conversation's name

This commit is contained in:
Sebastian Kaspari 2010-03-13 23:46:35 +01:00
parent 7376ba7856
commit 5f3948e6c5
3 changed files with 5 additions and 5 deletions

View File

@ -103,7 +103,7 @@ public class DeckAdapter extends BaseAdapter
public int getPositionByName(String name) public int getPositionByName(String name)
{ {
for (int i = 0; i < conversations.size(); i++) { for (int i = 0; i < conversations.size(); i++) {
if (conversations.get(i).getName().equals(name)) { if (conversations.get(i).getName().equalsIgnoreCase(name)) {
return i; return i;
} }
} }

View File

@ -61,7 +61,7 @@ public abstract class Conversation
{ {
this.buffer = Collections.synchronizedList(new LinkedList<Message>()); this.buffer = Collections.synchronizedList(new LinkedList<Message>());
this.history = Collections.synchronizedList(new LinkedList<Message>()); this.history = Collections.synchronizedList(new LinkedList<Message>());
this.name = name; this.name = name.toLowerCase();
} }
/** /**

View File

@ -229,7 +229,7 @@ public class Server
*/ */
public Conversation getConversation(String name) public Conversation getConversation(String name)
{ {
return conversations.get(name); return conversations.get(name.toLowerCase());
} }
/** /**
@ -239,7 +239,7 @@ public class Server
*/ */
public void addConversationl(Conversation conversation) public void addConversationl(Conversation conversation)
{ {
conversations.put(conversation.getName(), conversation); conversations.put(conversation.getName().toLowerCase(), conversation);
} }
/** /**
@ -249,7 +249,7 @@ public class Server
*/ */
public void removeConversation(String name) public void removeConversation(String name)
{ {
conversations.remove(name); conversations.remove(name.toLowerCase());
} }
/** /**