mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-12 08:32:04 +00:00
Hardcode community guidelines
This commit is contained in:
@@ -381,6 +381,11 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
PublicChatInfoUpdateWorker.scheduleInstant(this, publicChat.getServer(), publicChat.getChannel());
|
||||
} else if (openGroupV2 != null) {
|
||||
PublicChatInfoUpdateWorker.scheduleInstant(this, openGroupV2.getServer(), openGroupV2.getRoom());
|
||||
if (openGroupV2.getRoom().equals("session") || openGroupV2.getRoom().equals("oxen")
|
||||
|| openGroupV2.getRoom().equals("lokinet") || openGroupV2.getRoom().equals("crypto")) {
|
||||
View openGroupGuidelinesView = findViewById(R.id.open_group_guidelines_view);
|
||||
openGroupGuidelinesView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
View rootView = findViewById(R.id.rootView);
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package org.thoughtcrime.securesms.loki.activities
|
||||
|
||||
import android.os.Bundle
|
||||
import kotlinx.android.synthetic.main.activity_open_group_guidelines.*
|
||||
import network.loki.messenger.R
|
||||
import org.thoughtcrime.securesms.BaseActionBarActivity
|
||||
|
||||
class OpenGroupGuidelinesActivity : BaseActionBarActivity() {
|
||||
|
||||
// region Lifecycle
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_open_group_guidelines)
|
||||
communityGuidelinesTextView.text = """
|
||||
In order for our open group to be a fun environment, full of robust and constructive discussion, please follow these four simple rules:
|
||||
|
||||
1. Keep conversations on-topic and add value to the discussion (no referral links, spamming, or off-topic discussion).
|
||||
|
||||
2. You don't have to love everyone, but be civil (no baiting, excessively partisan arguments, threats, and so on; use common sense).
|
||||
|
||||
3. Do not be a shill. Comparison and criticism is reasonable, but blatant shilling is not.
|
||||
|
||||
4. Don't post explicit content, be it excessive offensive language, or content which is sexual or violent in nature.
|
||||
|
||||
If you break these rules, you’ll be warned by an admin. If your behaviour doesn’t improve, you will be removed from the open group.
|
||||
|
||||
If you see or experience any destructive behaviour, please contact an admin.
|
||||
|
||||
——————————
|
||||
|
||||
SCAMMER WARNING
|
||||
|
||||
Trust only those with an admin tag in the chat. No admin will ever DM you first. No admin will ever message you for Oxen coins.
|
||||
""".trimIndent()
|
||||
}
|
||||
// endregion
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package org.thoughtcrime.securesms.loki.views
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.FrameLayout
|
||||
import kotlinx.android.synthetic.main.view_open_group_guidelines.view.*
|
||||
import network.loki.messenger.R
|
||||
import org.thoughtcrime.securesms.conversation.ConversationActivity
|
||||
import org.thoughtcrime.securesms.loki.activities.OpenGroupGuidelinesActivity
|
||||
import org.thoughtcrime.securesms.loki.utilities.push
|
||||
|
||||
class OpenGroupGuidelinesView : FrameLayout {
|
||||
|
||||
constructor(context: Context) : super(context) {
|
||||
setUpViewHierarchy()
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
|
||||
setUpViewHierarchy()
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
|
||||
setUpViewHierarchy()
|
||||
}
|
||||
|
||||
private fun setUpViewHierarchy() {
|
||||
val inflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
|
||||
val contentView = inflater.inflate(R.layout.view_open_group_guidelines, null)
|
||||
addView(contentView)
|
||||
readButton.setOnClickListener {
|
||||
val activity = context as ConversationActivity
|
||||
val intent = Intent(activity, OpenGroupGuidelinesActivity::class.java)
|
||||
activity.push(intent)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user