[英]Ban a User in a particular firebase firestore group chat for predefined time
I am very new to coding.我对编码很陌生。 but i managed to build a group chat app using a low code platform called flutterflow.但我设法使用名为flutterflow的低代码平台构建了一个群聊应用程序。 i managed to spend significant amount of time on it and was able to build a public group chat app except few functionalities.我设法在它上面花费了大量时间,并且能够构建一个公共群聊应用程序,但功能很少。 I am hoping to find help from here.我希望能从这里得到帮助。 for the following questions.对于以下问题。
I have tried created a subcollection in groups called "banned user" and created two feilds.我尝试在名为“禁止用户”的组中创建一个子集合,并创建了两个字段。 one is "banned users" document reference to users.一是“禁止用户”文件对用户的引用。 and another is "banned_till" to record a time stamp until the user gets banned.另一个是“banned_till”,用于记录时间戳,直到用户被禁止。
Problem with this is when i ban a user twice, it creates two documents in the user reference with the same user.问题是当我两次禁止用户时,它会在用户参考中创建两个文档,并使用同一个用户。 and two documents has different "banned_till" times.并且两个文档具有不同的“banned_till”时间。 which one it is supposed to pick?它应该选择哪一个?
i tried to do this and put a conditional visibility to the chat that "if current time is less than or equal to banned_till time" it wont let user type in the textfield to chat.我试图做到这一点,并对聊天设置有条件的可见性,即“如果当前时间小于或等于banned_till 时间”,它不会让用户在文本字段中输入聊天内容。 but this is giving me gray screen.但这给了我灰屏。
I am very new to this.我对此很陌生。 any help would be appreciated.任何帮助,将不胜感激。
there is specific way to do so.有特定的方法可以做到这一点。 you have to set custom logic.你必须设置自定义逻辑。 like save all banned users in a firebase database object with thier max time and procced next.就像将所有被禁止的用户保存在 firebase 数据库 object 中,并设置他们的最大时间,然后进行下一步。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.