...
 
Commits (5)
......@@ -647,7 +647,7 @@ dependencies = [
"clear_on_drop",
"curve25519-dalek",
"rand 0.7.3",
"sha2 0.8.1",
"sha2 0.8.2",
]
[[package]]
......@@ -1180,9 +1180,9 @@ dependencies = [
[[package]]
name = "kv-log-macro"
version = "1.0.5"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a2d3beed37e5483887d81eb39de6de03a8346531410e1306ca48a9a89bd3a51"
checksum = "4ff57d6d215f7ca7eb35a9a64d656ba4d9d2bef114d741dc08048e75e2f5d418"
dependencies = [
"log",
]
......@@ -1315,6 +1315,7 @@ dependencies = [
"futures 0.3.5",
"libqaul",
"qaul-chat",
"qaul-files",
"qaul-voices",
"ratman",
"ratman-harness",
......@@ -1827,9 +1828,9 @@ checksum = "8e946095f9d3ed29ec38de908c22f95d9ac008e424c7bcae54c75a79c527c694"
[[package]]
name = "proc-macro2"
version = "1.0.15"
version = "1.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70a50b9351bfa8d65a7d93ce712dc63d2fd15ddbf2c36990fc7cac344859c04f"
checksum = "1502d12e458c49a4c9cbff560d0fe0060c252bc29799ed94ca2ed4bb665a0101"
dependencies = [
"unicode-xid",
]
......@@ -1859,6 +1860,7 @@ dependencies = [
"libqaul",
"mime",
"ratman-identity",
"serde",
]
[[package]]
......@@ -2246,9 +2248,9 @@ dependencies = [
[[package]]
name = "sha2"
version = "0.8.1"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "27044adfd2e1f077f649f59deb9490d3941d674002f7d062870a60ebe9bd47a0"
checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69"
dependencies = [
"block-buffer 0.7.3",
"digest 0.8.1",
......
......@@ -43,7 +43,13 @@ $ clients/android/build.sh
This script will take care of permission issues caused by the
container building everything as root already.
- TODO: build the webui
Follow the build instructions for the webgui. You can find them in
the contributors guide. After that, run the "pre-bundle" step of the
build.
```console
$ client/android/pre-bundle.sh
```
Finally you can finish the assembly process either in Android Studio
(and run it live on your phone or an emulator), or just use the
......@@ -54,7 +60,7 @@ $ cd clients/android
$ clients/android/gradlew assemble
```
A finished APK will appear in in `clients/android/app/build/outputs/apk/debug`.
A finished APK will appear in in `clients/android/app/build/outputs/apk/release`.
If you have questions about the build process, or if you're hitting
some problem, feel free to e-mail us on the mailing list, or just our
......
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply plugin: 'org.mozilla.rust-android-gradle.rust-android'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
ndkVersion "21.1.6352462"
......@@ -12,34 +16,55 @@ android {
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
cppFlags "-std=c++14"
}
}
externalNativeBuild { cmake { cppFlags "-std=c++14" } }
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
assets { srcDirs 'src/main/assets', 'src/main/webgui' }
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-annotations:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'android.arch.lifecycle:extensions:1.1.1'
implementation 'com.android.support:support-v4:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
cargo {
module = "../../../android-support"
module = "../../../android-support"
targetDirectory = "../../../target"
libname = "qauldroid"
targetIncludes = ['libqauldroid.so']
targets = ["arm64"]
targets = ["arm64"]
}
buildscript {
ext.kotlin_version = '1.3.72'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
repositories {
mavenCentral()
}
package net.qaul.app;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("net.qaul.app", appContext.getPackageName());
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.qaul.app">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<!-- Bluetooth connection mode -->
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<!-- Generic "beyond the firewall" network access -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- Needed for WiFi Direct -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
......@@ -19,7 +26,7 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<activity android:name=".ui.main.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
......
package net.qaul.app;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
protected long libqaulState;
static {
// The "android-support" crate creates a dynamic library called "libqauldroid"
// which we can include here simply via "qauldroid" because it's being put
// into the library search path via ~ m a g i c ~
System.loadLibrary("qauldroid");
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Example of a call to a native method
TextView tv = findViewById(R.id.sample_text);
tv.setText(hello("qaul.net"));
// Start the libqaul machinery under the hood
this.libqaulState = this.startServer(5000, "/");
System.out.println(this.libqaulState);
}
public native String hello(String to);
public native long startServer(int port, String path);
}
package net.qaul.app
import android.os.Bundle
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import java.io.*
class MainActivity : AppCompatActivity() {
protected var libqaulState: Long = 0
companion object {
init {
// The "android-support" crate creates a dynamic library called "libqauldroid"
// which we can include here simply via "qauldroid" because it's being put
// into the library search path via ~ m a g i c ~
System.loadLibrary("qauldroid")
}
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
// Example of a call to a native method
val tv = findViewById<TextView>(R.id.sample_text)
tv.text = hello("qaul.net")
var assetsPath: String? = null
try {
assetsPath = unpackAssets("")
} catch (e: Exception) {
e.printStackTrace()
}
// Start the libqaul machinery under the hood
libqaulState = startServer(5000, "$assetsPath/webgui")
println(libqaulState)
}
@Throws(Exception::class)
private fun unpackAssets(path: String): String {
val rootPath = applicationContext.filesDir.path
val assetManager = this.assets
val assets: Array<String>?
try {
assets = assetManager.list(path)
assert(assets != null)
if (assets!!.size == 0) {
copyFile(path)
} else {
val fullPath = "$rootPath/webgui/$path"
// Create the directory and recurse...
val dir = File(fullPath)
if (!dir.exists()) dir.mkdir()
for (child in assets) {
unpackAssets( if(path == "") child else "$path/$child" )
}
}
} catch (ex: IOException) {
ex.printStackTrace()
}
return applicationContext.filesDir.path
}
private fun copyFile(filename: String) {
val rootPath = applicationContext.filesDir.path
val assetManager = this.assets
val in_: InputStream
val out: OutputStream
try {
in_ = assetManager.open(filename)
val newFileName = "$rootPath/webgui/$filename"
out = FileOutputStream(newFileName)
val buffer = ByteArray(1024)
var read: Int
while (in_.read(buffer).also { read = it } != -1) {
out.write(buffer, 0, read)
}
in_.close()
out.flush()
out.close()
} catch (e: Exception) {
e.printStackTrace()
}
}
external fun hello(to: String?): String?
external fun startServer(port: Int, path: String?): Long
}
\ No newline at end of file
package net.qaul.app.net
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.net.wifi.p2p.WifiP2pManager
class WDReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
when(intent.action) {
WifiP2pManager.WIFI_P2P_STATE_CHANGED_ACTION -> {
val state = intent.getIntExtra(WifiP2pManager.EXTRA_WIFI_STATE, -1)
}
WifiP2pManager.WIFI_P2P_PEERS_CHANGED_ACTION -> {
// The peer list has changed! We should probably do something about
// that.
}
WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION -> {
// Connection state changed! We should probably do something about
// that.
}
WifiP2pManager.WIFI_P2P_THIS_DEVICE_CHANGED_ACTION -> {
}
}
}
}
\ No newline at end of file
package net.qaul.app
package net.qaul.app.net
import android.app.Service
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.net.wifi.p2p.WifiP2pManager
import android.os.IBinder
/** A handler for wifi direct messages and state */
class WifiDirectHandler {
class WDService : Service() {
private val intentFilter = IntentFilter()
init {
intentFilter.addAction(WifiP2pManager.WIFI_P2P_STATE_CHANGED_ACTION)
private lateinit var channel: WifiP2pManager.Channel
private lateinit var manager: WifiP2pManager
// Indicates a change in the list of available peers.
intentFilter.addAction(WifiP2pManager.WIFI_P2P_PEERS_CHANGED_ACTION)
override fun onBind(intent: Intent?): IBinder? {
return null
}
// Indicates the state of Wi-Fi P2P connectivity has changed.
intentFilter.addAction(WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION)
override fun onCreate() {
super.onCreate()
// Indicates this device's details have changed.
intentFilter.addAction(WifiP2pManager.WIFI_P2P_STATE_CHANGED_ACTION)
intentFilter.addAction(WifiP2pManager.WIFI_P2P_PEERS_CHANGED_ACTION)
intentFilter.addAction(WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION)
intentFilter.addAction(WifiP2pManager.WIFI_P2P_THIS_DEVICE_CHANGED_ACTION)
manager = getSystemService(Context.WIFI_P2P_SERVICE) as WifiP2pManager
channel = manager.initialize(this, mainLooper, null)
}
}
\ No newline at end of file
package net.qaul.app.ui.main
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import net.qaul.app.R
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private const val ARG_PARAM1 = "param1"
private const val ARG_PARAM2 = "param2"
/**
* A simple [Fragment] subclass.
* Use the [LoginFragment.newInstance] factory method to
* create an instance of this fragment.
*/
class LoginFragment : Fragment() {
// TODO: Rename and change types of parameters
private var param1: String? = null
private var param2: String? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
arguments?.let {
param1 = it.getString(ARG_PARAM1)
param2 = it.getString(ARG_PARAM2)
}
}
override fun onCreateView(inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?): View? {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_login, container, false)
}
companion object {
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment LoginFragment.
*/
// TODO: Rename and change types and number of parameters
@JvmStatic
fun newInstance(param1: String, param2: String) =
LoginFragment().apply {
arguments = Bundle().apply {
putString(ARG_PARAM1, param1)
putString(ARG_PARAM2, param2)
}
}
}
}
package net.qaul.app.ui.main
import android.os.Bundle
import android.text.Layout
import android.view.ViewGroup
import android.widget.LinearLayout
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import net.qaul.app.R
import java.io.*
class MainActivity : AppCompatActivity() {
protected var libqaulState: Long = 0
companion object {
init {
// The "android-support" crate creates a dynamic library called "libqauldroid"
// which we can include here simply via "qauldroid" because it's being put
// into the library search path via ~ m a g i c ~
System.loadLibrary("qauldroid")
}
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
// Example of a call to a native method
val tv = findViewById<TextView>(R.id.sample_text)
tv.text = hello("qaul.net")
var assetsPath: String? = null
try {
assetsPath = unpackAssets("")
} catch (e: Exception) {
e.printStackTrace()
}
// Start the libqaul machinery under the hood
libqaulState = startServer(5000, "$assetsPath/webgui")
println(libqaulState)
}
@Throws(Exception::class)
private fun unpackAssets(path: String): String {
val rootPath = applicationContext.filesDir.path
val assetManager = this.assets
val assets: Array<String>?
try {
assets = assetManager.list(path)
assert(assets != null)
if (assets!!.size == 0) {
copyFile(path)
} else {
val fullPath = "$rootPath/webgui/$path"
// Create the directory and recurse...
val dir = File(fullPath)
if (!dir.exists()) dir.mkdir()
for (child in assets) {
unpackAssets( if(path == "") child else "$path/$child" )
}
}
} catch (ex: IOException) {
ex.printStackTrace()
}
return applicationContext.filesDir.path
}
private fun copyFile(filename: String) {
val rootPath = applicationContext.filesDir.path
val assetManager = this.assets
val in_: InputStream
val out: OutputStream
try {
in_ = assetManager.open(filename)
val newFileName = "$rootPath/webgui/$filename"
out = FileOutputStream(newFileName)
val buffer = ByteArray(1024)
var read: Int
while (in_.read(buffer).also { read = it } != -1) {
out.write(buffer, 0, read)
}
in_.close()
out.flush()
out.close()
} catch (e: Exception) {
e.printStackTrace()
}
}
external fun hello(to: String?): String?
external fun startServer(port: Int, path: String?): Long
}
\ No newline at end of file
package net.qaul.app
package net.qaul.app.util
/** A bridge interface for native initialisation */
class NativeBridge {
......
......@@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
tools:context=".ui.main.MainActivity">
<TextView
android:id="@+id/sample_text"
......
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.main.LoginFragment">
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/hello_blank_fragment" />
</FrameLayout>
\ No newline at end of file
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
</resources>
<resources>
<string name="app_name">qaul.net</string>
<string name="title_activity_login">Join qaul.net</string>
<string name="prompt_email">Email</string>
<string name="prompt_password">Password</string>
<string name="action_sign_in">Sign in or register</string>
<string name="action_sign_in_short">Sign in</string>
<string name="welcome">"Welcome !"</string>
<string name="invalid_username">Not a valid username</string>
<string name="invalid_password">Password must be >5 characters</string>
<string name="login_failed">"Login failed"</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
</resources>
package net.qaul.app;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}
\ No newline at end of file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.61'
repositories {
google()
jcenter()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.1'
classpath 'com.android.tools.build:gradle:3.6.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'gradle.plugin.org.mozilla.rust-android-gradle:plugin:0.8.3'
// NOTE: Do not place your application dependencies here; they belong
......@@ -15,7 +17,6 @@ buildscript {
}
}
allprojects {
repositories {
google()
......
#!/usr/bin/env bash
set -ex
# Run this script before assembling the application
BASEDIR=$(realpath $(dirname "$0"))
NOW_DIR=$(pwd)
cd $BASEDIR
cp -vr ../../webgui/dist app/src/main/webgui
cd $NOW_DIR
......@@ -17,7 +17,10 @@ async fn main() {
let cfg = cfg::match_fold(app);
// Initialise the logger after CLI validation
let _subscriber = fmt().with_env_filter("async-std=error").with_max_level(Level::DEBUG).init();
let _subscriber = fmt()
.with_env_filter("async-std=error")
.with_max_level(Level::DEBUG)
.init();
info!("Initialised logger: welcome to qauld!");
let _state = State::new(&cfg).await;
......
......@@ -6,14 +6,16 @@ authors = ["Katharina Fey <kookie@spacekookie.de>", "jess 3jane <me@jess.coffee>
edition = "2018"
[features]
default = ["proto", "json", "chat"]
default = ["proto", "json", "chat", "files", "voices"]
proto = ["capnp"]
json = ["serde_json"]
chat = ["qaul-chat"]
files = ["qaul-files"]
voices = ["qaul-voices"]
[dependencies]
qaul-chat = { path = "../service/chat", optional = true }
qaul-files = { path = "../service/files", optional = true }
qaul-voices = { path = "../service/voices", optional = true }
libqaul = { version = "*", path = ".." }
......
......@@ -2,7 +2,8 @@
use crate::QaulRpc;
use async_trait::async_trait;
use libqaul::{files::FileFilter, users::UserAuth, Identity};
use libqaul::{users::UserAuth, Identity};
use qaul_files::types::FileFilter;
/// Send a file store query
#[derive(PartialEq)]
......
......@@ -9,3 +9,4 @@ license = "AGPL-3.0"
identity = { path = "../../../ratman/identity", package = "ratman-identity" }
libqaul = { path = "../../" }
mime = "0.3"
serde = { version = "1.0" }
//! `qaul.net` filesharing service
//!
//! Provides a simple interface to announce and broadcast binary
//! payload recipient messages. Files can either be directly sent, or
//! they can be advertised, then pulled with a unique file ID,
//! contained in the announcement.
// #![allow(unused)]
use std::sync::Arc;
use libqaul::{error::Result, Qaul};
use std::sync::Arc;
const ASC_NAME: &'static str = "net.qaul.filesharing";
use crate::types::{File, FileFilter, FileId};
// /// A typed file that can be sent across the network
// pub struct File {
// pub name: String,
// pub mime: Mime,
// pub data: Vec<u8>,
// }
pub mod types;
// // TODO: Partial files/ file progress
// // TODO: Download links with tokens
// TODO: Partial files
// TODO: file progress
// TODO: Download links with tokens
const ASC_NAME: &'static str = "net.qaul.fileshare";
/// Filesharing service state
#[derive(Clone)]
pub struct Filesharing {
pub struct Fileshare {
qaul: Arc<Qaul>,
}
impl Filesharing {
impl Fileshare {
/// Initialise the filesharing service
///
/// In order to initialise, a valid and running
......@@ -37,10 +29,21 @@ impl Filesharing {
Ok(Self { qaul })
}
// /// Announce a new file into a network
// pub fn announce<S>(&self, name: S) -> Result<FileId> {
/// Advertise a new file into a network
pub fn advertise(
&self,
file_name: String,
file_id: FileId,
file_size: usize,
file_type: FileFilter,
) -> Result<FileId> {
unimplemented!()
}
// }
/// Request a file with a given file id
pub fn request(&self, file_id: FileId) -> Result<File> {
unimplemented!()
}
}
// impl<'q> Filesharing<'q> {
......
#![allow(unused)]
use crate::error::Result;
use crate::users::UserAuth;
use crate::Identity;
use serde::{Deserialize, Serialize};
use libqaul::error::Result;
use libqaul::Identity;
use libqaul::users::UserAuth;
pub type FileId = Identity;
/// Local file abstraction
......@@ -74,37 +73,37 @@ pub struct Files<'chain> {
impl<'qaul> Files<'qaul> {
/// Query the local file store for a specific constraint
pub fn query<I>(&self, user: UserAuth, filter: FileFilter) -> Result<I>
where
I: Iterator<Item = FileMeta>,
where
I: Iterator<Item=FileMeta>,
{
self.q.auth.trusted(user)?;
// self.q.auth.trusted(user)?;
unimplemented!()
}
/// List all available files
pub fn list<I>(&self, user: UserAuth) -> Result<I>
where
I: Iterator<Item = FileMeta>,
where
I: Iterator<Item=FileMeta>,
{
self.q.auth.trusted(user)?;
// self.q.auth.trusted(user)?;
unimplemented!()
}
/// Stream one particular file from storage
pub async fn get(&self, user: UserAuth, file: FileId) -> Result<File> {
self.q.auth.trusted(user)?;
// self.q.auth.trusted(user)?;
unimplemented!()
}
/// Adds a new file to the local user's storage
pub fn add(&self, user: UserAuth, name: &str, file: File) -> Result<FileId> {
self.q.auth.trusted(user)?;
// self.q.auth.trusted(user)?;
unimplemented!()
}
/// Delete a file from the local user store
pub fn delete(&self, user: UserAuth, name: FileId) -> Result<()> {
self.q.auth.trusted(user)?;
// self.q.auth.trusted(user)?;
unimplemented!()
}
}
......@@ -21,9 +21,6 @@
pub use contacts::Contacts;
pub(crate) mod contacts;
pub use files::Files;
pub(crate) mod files;
pub use messages::Messages;
pub(crate) mod messages;
......
//! API fascade module?
pub use crate::api::files::{FileFilter, FileId, FileMeta};
......@@ -50,7 +50,6 @@ mod utils;
pub mod api;
pub mod contacts;
pub mod error;
pub mod files;
pub mod messages;
pub mod services;
pub mod users;
......
This diff is collapsed.