// relation.activate(),如果已进入房间. group.resource().equals(relation.name()), 昵称未变
return relation.activate() ? group.resource().equals(relation.name()) ? this.resend ? this.proxy.input(context, protocol) : false : this.writeAndReturn(context, group, nickname, relation) : true;
}
private boolean writeAndReturn(JIDContext context, JID group, String nickname, MucRelation relation) {
Room room = this.room.build(group);
// 通知其他房客昵称修改
Presence presence = new Presence();
for (Relation each : super.myRelations(group)) {
JID to = super.build(each.cast(MucRelation.class).jid());
super.findOne(to, true).write(presence.clear().add(this.adder.add(new XUser(group, to, room.allowed(to, RoomConfig.WHOISEXISTS)).item(new Item(room.allowed(to, RoomConfig.WHOISALLOW, context.jid()), nickname, relation))).cast(XUser.class)).type(PresenceType.UNAVAILABLE).setFrom(group.resource(relation.name())));
}
return false;
}