Skip to content

Commit 8af6e87

Browse files
committed
enable message editing on IRC servers that support labeled-response cap
1 parent 69fb7bd commit 8af6e87

4 files changed

Lines changed: 7 additions & 3 deletions

File tree

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ android {
6969
testBuildType "mockdata"
7070

7171
defaultConfig {
72-
versionCode 341
72+
versionCode 342
7373
versionName "4.29"
7474
minSdkVersion 22
7575
targetSdkVersion 31

res/layout/activity_message.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
android:background="?contentBackgroundColor"
9393
android:layout_width="match_parent"
9494
android:layout_height="wrap_content"
95-
android:paddingTop="12dp"
95+
android:paddingTop="8dp"
9696
android:gravity="bottom">
9797

9898
<ImageButton

src/com/irccloud/android/activity/MainActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5488,7 +5488,7 @@ public boolean onMessageLongClicked(Event event) {
54885488

54895489
boolean canEdit = event.self;
54905490
Server s = ServersList.getInstance().getServer(event.cid);
5491-
if(s == null || !(s.isSlack() || s.getOrgId() > 0))
5491+
if(s == null || !s.hasLabeledResponse())
54925492
canEdit = false;
54935493

54945494
showUserPopup(user, ColorFormatter.html_to_spanned(ColorFormatter.irc_to_html(timestamp + " " + html), true, ServersList.getInstance().getServer(event.cid)), null, msgid, canEdit, event);

src/com/irccloud/android/data/model/Server.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,10 @@ public boolean hasCap(String cap) {
358358
return false;
359359
}
360360

361+
public boolean hasLabeledResponse() {
362+
return hasCap("labeled-response") || hasCap("draft/labeled-response") || hasCap("draft/labeled-response-0.2");
363+
}
364+
361365
public boolean clientTagDeny(String tagname) {
362366
if(isupport == null || !isupport.has("CLIENTTAGDENY") || !isupport.get("CLIENTTAGDENY").isTextual())
363367
return false;

0 commit comments

Comments
 (0)