Remove open group guidelines on official open groups (#933)

* refactor: remove binding references and code that handles official open groups

* refactor: remove open group guidelines activity and layouts
This commit is contained in:
Harris 2022-09-13 15:55:24 +10:00 committed by GitHub
parent 9f8ed4daf2
commit bd51cbf6fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 0 additions and 200 deletions

View File

@ -231,10 +231,6 @@
android:screenOrientation="portrait"
android:theme="@style/Theme.TextSecure.DayNight">
</activity>
<activity
android:name="org.thoughtcrime.securesms.groups.OpenGroupGuidelinesActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.TextSecure.DayNight" />
<activity
android:name="org.thoughtcrime.securesms.longmessage.LongMessageActivity"
android:screenOrientation="portrait"

View File

@ -1,28 +0,0 @@
package org.thoughtcrime.securesms.conversation.v2.components
import android.content.Context
import android.content.Intent
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.FrameLayout
import network.loki.messenger.databinding.ViewOpenGroupGuidelinesBinding
import org.thoughtcrime.securesms.conversation.v2.ConversationActivityV2
import org.thoughtcrime.securesms.groups.OpenGroupGuidelinesActivity
import org.thoughtcrime.securesms.util.push
class OpenGroupGuidelinesView : FrameLayout {
constructor(context: Context) : super(context) { initialize() }
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) { initialize() }
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) { initialize() }
private fun initialize() {
ViewOpenGroupGuidelinesBinding.inflate(LayoutInflater.from(context), this, true).apply {
readButton.setOnClickListener {
val activity = context as ConversationActivityV2
val intent = Intent(activity, OpenGroupGuidelinesActivity::class.java)
activity.push(intent)
}
}
}
}

View File

@ -1,51 +0,0 @@
package org.thoughtcrime.securesms.groups
import android.os.Bundle
import network.loki.messenger.databinding.ActivityOpenGroupGuidelinesBinding
import org.thoughtcrime.securesms.BaseActionBarActivity
class OpenGroupGuidelinesActivity : BaseActionBarActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val binding = ActivityOpenGroupGuidelinesBinding.inflate(layoutInflater)
setContentView(binding.root)
binding.communityGuidelinesTextView.text = """
Welcome to Oxen.
Oxen believes privacy is an important part of our future. People have been safeguarding the right to privacy since the dawn of humanity, but the digital world has turned privacy into a privilege. Enough is enough. We're taking it back. For you. For us. For everyone.
Oxen is a private technology stack including the Oxen blockchain, Oxen service nodes (Sessions servers), the Oxen cryptocurrency, an onion-router called Lokinet, and Session itself.
Oxen is what makes Session possible Session is running on the Oxen network right now.
Find out more at https://oxen.io, or ask here!
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, youll be warned by an admin. If your behaviour doesnt 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 crown in chat. No admin will ever DM you first. No admin will ever message you for Oxen coins.
""".trimIndent()
}
}

View File

@ -32,7 +32,6 @@ import kotlin.coroutines.resumeWithException
import kotlin.coroutines.suspendCoroutine
interface ConversationRepository {
fun isOxenHostedOpenGroup(threadId: Long): Boolean
fun maybeGetRecipientForThreadId(threadId: Long): Recipient?
fun saveDraft(threadId: Long, text: String)
fun getDraft(threadId: Long): String?
@ -86,11 +85,6 @@ class DefaultConversationRepository @Inject constructor(
private val sessionJobDb: SessionJobDatabase
) : ConversationRepository {
override fun isOxenHostedOpenGroup(threadId: Long): Boolean {
val openGroup = lokiThreadDb.getOpenGroupChat(threadId)
return openGroup?.publicKey == OpenGroupApi.defaultServerPublicKey
}
override fun maybeGetRecipientForThreadId(threadId: Long): Recipient? {
return threadDb.getRecipientForThreadId(threadId)
}

View File

@ -1,36 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/large_spacing"
android:layout_marginTop="@dimen/large_spacing"
android:layout_marginRight="@dimen/large_spacing"
android:textSize="@dimen/large_font_size"
android:textStyle="bold"
android:textColor="@color/text"
android:text="@string/ConversationActivity_open_group_guidelines" />
<TextView
android:id="@+id/communityGuidelinesTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/large_spacing"
android:layout_marginTop="@dimen/medium_spacing"
android:layout_marginRight="@dimen/large_spacing"
android:layout_marginBottom="@dimen/large_spacing"
android:textSize="@dimen/small_font_size"
android:textColor="@color/text" />
</LinearLayout>
</ScrollView>

View File

@ -1,75 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/cell_background"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingLeft="12dp"
android:paddingTop="@dimen/small_spacing"
android:paddingBottom="@dimen/small_spacing"
android:orientation="horizontal">
<View
android:layout_width="2dp"
android:layout_height="match_parent"
android:layout_marginRight="@dimen/small_spacing"
android:background="@color/accent" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/titleTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/text"
android:textSize="15dp"
android:textStyle="bold"
android:maxLines="1"
android:ellipsize="end"
android:text="@string/open_group_guidelines_pinned_message" />
<TextView
android:layout_width="wrap_content"
android:maxWidth="260dp"
android:layout_height="wrap_content"
android:textColor="@color/text"
android:textSize="15dp"
android:maxLines="1"
android:ellipsize="end"
android:text="@string/open_group_guidelines_community_guidelines" />
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:minWidth="@dimen/small_spacing" />
<Button
style="@style/Widget.Session.Button.Common.ProminentOutline"
android:id="@+id/readButton"
android:layout_width="wrap_content"
android:layout_height="@dimen/small_button_height"
android:layout_marginRight="12dp"
android:textSize="15dp"
android:textStyle="normal"
android:text="@string/open_group_guidelines_read" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="?android:dividerHorizontal" />
</LinearLayout>