Commit 101c7cdf authored by Julian Sparber's avatar Julian Sparber

use only @ with tab-compleation

parent 798c6d31
......@@ -2571,35 +2571,25 @@ impl AppOp {
popover.popdown();
return;
}
Some(ref t) if t.len() < 3 && !t.starts_with("@") => {
popover.popdown();
return;
}
Some(txt) => {
if let Some(last) = txt.split(' ').last() {
let n = last.len();
if n < 3 && !last.starts_with("@") {
if !last.starts_with("@") {
popover.popdown();
return;
}
let mut show = false;
/*remove @ from string*/
let w = if last.starts_with("@") {
last[1..].to_lowercase()
}
else {
last.to_lowercase()
};
let w = last[1..].to_lowercase();
/* Maybe search for the 5 most recent active users */
if let Some(aroom) = self.active_room.clone() {
if let Some(r) = self.rooms.get(&aroom) {
let mut count = 0;
for (_, m) in r.members.iter() {
let alias = m.alias.clone().unwrap_or_default().to_lowercase();
let alias = m.alias.clone().unwrap_or_default();
let uid = &m.uid.clone().to_lowercase()[1..];
if alias.starts_with(&w) || uid.starts_with(&w) {
if alias.to_lowercase().starts_with(&w) || uid.starts_with(&w) {
let widget;
{
let mb = widgets::MemberBox::new(&m, &self);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment