pinChats method
dynamic
pinChats()
Implementation
pinChats() {
if (isSelectedPositionsValidForPin()) {
LogMessage.d("pinChat", "isSelectedPositionsValidForPin");
if (selectedChats.length == 1) {
_itemPin(0);
clearAllChatSelection();
toToast(getTranslated("chatPinned"));
} else {
selected(false);
for (var index = 0; index < selectedChats.length; index++) {
var selectedChat = recentChats.indexWhere((p0) =>
p0.jid == selectedChats[index] && p0.isChatPinned.checkNull());
if (selectedChat.isNegative) {
LogMessage.d(
"pinChat", "$selectedChat selected chat is have to pinned");
_itemPin(index);
} else {
LogMessage.d(
"pinChat", "$selectedChat selected chat is already pinned");
}
}
clearAllChatSelection();
toToast(getTranslated("chatsPinned"));
}
} else {
toToast(getTranslated("chatPinLimit"));
}
}