aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreta <hi@theta.eu.org>2019-11-07 21:44:53 +0000
committereta <hi@theta.eu.org>2019-11-07 21:44:53 +0000
commitae81c18da1b3fc73c3c8103e85efff68fcde7c3c (patch)
tree3479f176be87809e9ef46c1803598ad565a3b182
parentc8d64e6cae752f898e9f7b269c47b4e2af131306 (diff)
downloadsms-irc-ae81c18da1b3fc73c3c8103e85efff68fcde7c3c.tar.gz
sms-irc-ae81c18da1b3fc73c3c8103e85efff68fcde7c3c.tar.bz2
sms-irc-ae81c18da1b3fc73c3c8103e85efff68fcde7c3c.zip
Avoid getting stuck in a stupid loop changing nick sources
-rw-r--r--src/insp_s2s.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/insp_s2s.rs b/src/insp_s2s.rs
index 04b9506..4320a44 100644
--- a/src/insp_s2s.rs
+++ b/src/insp_s2s.rs
@@ -150,7 +150,7 @@ impl ContactManagerManager for InspLink {
let ct = self.contacts.get(a).unwrap();
self.outbox.push(Message::new(Some(&ct.uuid), "AWAY", vec![], text.as_ref().map(|x| x as &str))?);
},
- ContactManagerCommand::ChangeNick(st, src) => {
+ ContactManagerCommand::ChangeNick(st, osrc) => {
{
// Abort if we're trying to change nick to something
// it already is, because otherwise it'll collide.
@@ -161,9 +161,9 @@ impl ContactManagerManager for InspLink {
return Ok(())
}
}
- let nick = match self.check_nick_for_collisions(&st) {
- Some(n) => n,
- None => st.into()
+ let (nick, src) = match self.check_nick_for_collisions(&st) {
+ Some(n) => (n, Recipient::NICKSRC_COLLISION),
+ None => (st.into(), osrc)
};
let ct = self.contacts.get(a).unwrap();
let u = self.users.get_mut(&ct.uuid).unwrap();