mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-25 01:07:47 +00:00
Merge branch 'dev' of https://github.com/loki-project/session-android into attachment-in-conversation-preview
This commit is contained in:
commit
bf272787fe
@ -3,13 +3,11 @@
|
|||||||
android:height="24dp"
|
android:height="24dp"
|
||||||
android:viewportWidth="24"
|
android:viewportWidth="24"
|
||||||
android:viewportHeight="24"
|
android:viewportHeight="24"
|
||||||
android:tint="?attr/colorControlNormal">
|
android:tint="?android:colorControlNormal">
|
||||||
<path
|
<path
|
||||||
android:strokeWidth="1.5"
|
android:pathData="M8.8496,2.2148L8.627,2.459L7.1289,4.0938L4.4805,4.0938C3.0376,4.0938 1.8496,5.28 1.8496,6.7227L1.8496,17.9961C1.8496,19.4388 3.0376,20.625 4.4805,20.625L19.5195,20.625C20.9624,20.625 22.1504,19.4388 22.1504,17.9961L22.1504,6.7227C22.1504,5.28 20.9624,4.0938 19.5195,4.0938L16.8711,4.0938L15.1504,2.2148L8.8496,2.2148zM9.5098,3.7148L14.4902,3.7148L16.2109,5.5938L19.5195,5.5938C20.1447,5.5938 20.6504,6.0987 20.6504,6.7227L20.6504,17.9961C20.6504,18.6201 20.1447,19.125 19.5195,19.125L4.4805,19.125C3.8553,19.125 3.3496,18.62 3.3496,17.9961L3.3496,6.7227C3.3496,6.0987 3.8553,5.5938 4.4805,5.5938L7.7891,5.5938L9.5098,3.7148z"
|
||||||
android:pathData="M 9.1799478,2.9655 7.4596583,4.844265 H 4.4799837 c -1.0339942,0 -1.8800277,0.8454653 -1.8800277,1.878765 v 11.273221 c 0,1.033342 0.8460019,1.878765 1.8800277,1.878765 H 19.520416 c 1.033994,0 1.880028,-0.845465 1.880028,-1.878765 V 6.72303 c 0,-1.0333418 -0.846002,-1.878765 -1.880028,-1.878765 H 16.540742 L 14.820452,2.9655 Z"
|
android:fillColor="#000000"/>
|
||||||
android:strokeColor="@android:color/white"/>
|
|
||||||
<path
|
<path
|
||||||
android:strokeWidth="1.5"
|
android:pathData="M12,7.4648C9.2499,7.4648 7.0039,9.7109 7.0039,12.4609C7.0039,15.211 9.2499,17.457 12,17.457C14.7501,17.457 16.9961,15.211 16.9961,12.4609C16.9961,9.7109 14.7501,7.4648 12,7.4648zM12,8.9648C13.9394,8.9648 15.4961,10.5215 15.4961,12.4609C15.4961,14.4003 13.9394,15.957 12,15.957C10.0606,15.957 8.5039,14.4003 8.5039,12.4609C8.5039,10.5215 10.0606,8.9648 12,8.9648z"
|
||||||
android:pathData="m 11.99999,16.70635 c -2.3447128,0 -4.2454779,-1.900765 -4.2454782,-4.245478 -3e-7,-2.344713 1.9007652,-4.2454787 4.2454782,-4.2454789 2.344713,-2e-7 4.245479,1.9007659 4.245479,4.2454789 0,2.344713 -1.900766,4.245478 -4.245479,4.245478 z"
|
android:fillColor="#000000"/>
|
||||||
android:strokeColor="@android:color/white"/>
|
|
||||||
</vector>
|
</vector>
|
||||||
|
@ -186,6 +186,12 @@ class PublicChatPoller(private val context: Context, private val group: PublicCh
|
|||||||
}
|
}
|
||||||
fun processOutgoingMessage(message: PublicChatMessage) {
|
fun processOutgoingMessage(message: PublicChatMessage) {
|
||||||
val messageServerID = message.serverID ?: return
|
val messageServerID = message.serverID ?: return
|
||||||
|
val messageID = DatabaseFactory.getLokiMessageDatabase(context).getMessageID(messageServerID)
|
||||||
|
var isDuplicate = false
|
||||||
|
if (messageID != null) {
|
||||||
|
isDuplicate = DatabaseFactory.getMmsDatabase(context).getThreadIdForMessage(messageID) > 0 || DatabaseFactory.getSmsDatabase(context).getThreadIdForMessage(messageID) > 0
|
||||||
|
}
|
||||||
|
if (isDuplicate) { return }
|
||||||
if (message.body.isEmpty() && message.attachments.isEmpty() && message.quote == null) { return }
|
if (message.body.isEmpty() && message.attachments.isEmpty() && message.quote == null) { return }
|
||||||
val userHexEncodedPublicKey = TextSecurePreferences.getLocalNumber(context)
|
val userHexEncodedPublicKey = TextSecurePreferences.getLocalNumber(context)
|
||||||
val dataMessage = getDataMessage(message)
|
val dataMessage = getDataMessage(message)
|
||||||
|
@ -226,7 +226,9 @@ public class MediaUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isImageType(String contentType) {
|
public static boolean isImageType(String contentType) {
|
||||||
return (null != contentType) && contentType.startsWith("image/");
|
return (null != contentType)
|
||||||
|
&& contentType.startsWith("image/")
|
||||||
|
&& !contentType.contains("svg"); // Do not treat SVGs as regular images.
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isAudioType(String contentType) {
|
public static boolean isAudioType(String contentType) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user