Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/balzack/databag into main
Browse files Browse the repository at this point in the history
  • Loading branch information
balzack committed Jul 11, 2023
2 parents ead73db + e918f3a commit e547949
Show file tree
Hide file tree
Showing 11 changed files with 2,665 additions and 2,533 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ Databag is a self-hosted messaging service. Notable features include:

<br>
<p align="center">
<a href="https://f-droid.org/en/packages/com.databag/">
<img src="/doc/fdroid.png" width="18%">
</a>
<a href="https://apps.apple.com/us/app/databag/id6443741428">
<img src="/doc/astore.png" width="18%">
</a>
Expand All @@ -41,7 +44,7 @@ Databag is a self-hosted messaging service. Notable features include:
</a>
</p>

The app is available in the google and apple stores; [F-Droid](https://gitlab.com/fdroid/fdroiddata/-/merge_requests/12183) inclusion is in progress. You can also test out the project [here](https://databag.coredb.org/#/create), but don't post anything important as this server is regularly wiped. Feedback on the UI/UX, bugs or features is greatly appreciated.
The app is available on fdroid as well as the google and apple stores. You can test out the project [here](https://databag.coredb.org/#/create), but don't post anything important as this server is regularly wiped. Feedback on the UI/UX, bugs or features is greatly appreciated.

## Installation

Expand All @@ -55,7 +58,7 @@ From the net/container sub directory:
### Example with Portainer and Nginx Proxy Manager

From Portainer:
- In the volume view, click add volumen:
- In the volume view, click add volume:
- Enter a name, then click 'Create the volume'
- In the container view, click add container:
- In the 'Image' field enter 'balzack/databag:latest'
Expand Down
27 changes: 14 additions & 13 deletions app/mobile/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,18 @@ android {

compileSdkVersion rootProject.ext.compileSdkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

namespace "com.databag"
defaultConfig {
applicationId "com.databag"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
versionCode 1015
versionName "1.5"
}

splits {
Expand All @@ -117,12 +117,12 @@ android {
}
}
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
release {
storeFile file('balzack.keystore')
storePassword 'balzack'
keyAlias 'balzack'
keyPassword 'balzack'
}
}
buildTypes {
debug {
Expand All @@ -131,7 +131,7 @@ android {
release {
// Caution! In production, you need to generate your own keystore file.
// see https://reactnative.dev/docs/signed-apk-android.
signingConfig signingConfigs.debug
signingConfig signingConfigs.release
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
Expand All @@ -158,6 +158,7 @@ dependencies {
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")


implementation 'androidx.core:core:1.8.0'

implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")
Expand Down
4 changes: 2 additions & 2 deletions app/mobile/ios/Databag.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.15;
MARKETING_VERSION = 1.17;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -656,7 +656,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.15;
MARKETING_VERSION = 1.17;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down
1 change: 1 addition & 0 deletions app/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"moment": "^2.29.4",
"react": "18.2.0",
"react-native": "0.71.3",
"react-native-awesome-gallery": "^0.3.5",
"react-native-base64": "^0.2.1",
"react-native-create-thumbnail": "^1.6.4",
"react-native-device-info": "^10.4.0",
Expand Down
6 changes: 3 additions & 3 deletions app/mobile/src/context/useAppContext.hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export function useAppContext() {
updateState({ loggedOut: false });
await addAccount(server, username, password, token);
const session = await setLogin(username, server, password, getApplicationName(), getVersion(), getDeviceId(), deviceToken.current, pushType.current, notifications)
access.current = { server, token: session.appToken, guid: session.guid };
access.current = { loginTimestamp: session.created, server, token: session.appToken, guid: session.guid };
await store.actions.setSession(access.current);
await setSession();
if (session.pushSupported) {
Expand All @@ -127,7 +127,7 @@ export function useAppContext() {
}
updateState({ loggedOut: false });
const session = await setAccountAccess(server, token, getApplicationName(), getVersion(), getDeviceId(), deviceToken.current, pushType.current, notifications);
access.current = { server, token: session.appToken, guid: session.guid };
access.current = { loginTimestamp: session.created, server, token: session.appToken, guid: session.guid };
await store.actions.setSession(access.current);
await setSession();
if (session.pushSupported) {
Expand All @@ -141,7 +141,7 @@ export function useAppContext() {
updateState({ loggedOut: false });
const acc = username.split('@');
const session = await setLogin(acc[0], acc[1], password, getApplicationName(), getVersion(), getDeviceId(), deviceToken.current, pushType.current, notifications)
access.current = { server: acc[1], token: session.appToken, guid: session.guid };
access.current = { loginTimestamp: session.created, server: acc[1], token: session.appToken, guid: session.guid };
await store.actions.setSession(access.current);
await setSession();
if (session.pushSupported) {
Expand Down
5 changes: 1 addition & 4 deletions app/mobile/src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"name": "src",
"dependencies": {
"react-native-fs": "^2.20.0"
}
"name": "src"
}
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export function TopicItem({ item, focused, focus, hosting, remove, update, block
<SafeAreaView style={styles.modal} edges={['top','bottom','left','right']}>
<GestureHandlerRootView>
<Carousel
loop
loop={false}
width={state.width}
autoPlay={false}
data={state.assets}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,22 @@ import { styles } from './ImageAsset.styled';
import Colors from 'constants/Colors';
import Ionicons from 'react-native-vector-icons/AntDesign';
import FastImage from 'react-native-fast-image'
import Gallery from 'react-native-awesome-gallery';

export function ImageAsset({ asset, dismiss }) {
const { state, actions } = useImageAsset(asset);

return (
<TouchableOpacity style={styles.container} activeOpacity={1} onPress={actions.showControls}>
<FastImage source={{ uri: asset.thumb }} onLoad={actions.setRatio}
style={{ ...styles.thumb, width: state.imageWidth, height: state.imageHeight }}
resizeMode={FastImage.resizeMode.contain} />
<TouchableOpacity activeOpacity={1} style={{ display: 'flex', width: '100%', height: '100%' }} onPress={actions.showControls}>
{ state.url && (
<FastImage source={{ uri: state.url }} onLoad={actions.loaded}
style={{ ...styles.main, width: state.imageWidth, height: state.imageHeight }}
resizeMode={FastImage.resizeMode.contain} />
<Gallery data={[ state.url ]} onIndexChange={actions.loaded}
style={{ ...styles.main }} />
)}

{ state.loaded && state.controls && (
{ state.controls && (
<TouchableOpacity style={styles.close} onPress={dismiss}>
<Ionicons name={'close'} size={32} color={Colors.white} />
</TouchableOpacity>
)}

{ state.failed && (
<TouchableOpacity style={styles.loading} onPress={dismiss}>
<ActivityIndicator color={Colors.alert} size="large" />
</TouchableOpacity>
)}
{ !state.loaded && !state.failed && (
<TouchableOpacity style={styles.loading} onPress={dismiss}>
<ActivityIndicator color={Colors.white} size="large" />
{ asset.total > 1 && (
<Text style={styles.decrypting}>{ asset.block } / { asset.total }</Text>
)}
</TouchableOpacity>
)}
</TouchableOpacity>
);
}
5 changes: 4 additions & 1 deletion app/mobile/src/session/conversation/useConversation.hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ export function useConversation() {
cardImageUrl = card.actions.getCardImageUrl;
const { logo, subject } = getChannelSubjectLogo(cardId, profileGuid, channel, cards, cardImageUrl);

if (channel?.topicRevision && channel.readRevision !== channel.topicRevision) {
conversation.actions.setChannelReadRevision(channel.topicRevision);
}

const items = Array.from(conversation.state.topics.values());
const sorted = items.sort((a, b) => {
const aTimestamp = a?.detail?.created;
Expand All @@ -100,7 +104,6 @@ export function useConversation() {
}, 100);

}, [conversation.state, profile.state]);


const actions = {
setFocus: (focus) => {
Expand Down
Loading

0 comments on commit e547949

Please sign in to comment.