diff --git a/.gitignore b/.gitignore index e333c78a6d..81c8fbfbec 100644 --- a/.gitignore +++ b/.gitignore @@ -25,7 +25,7 @@ project.xcworkspace # Android/IJ # .idea -.gradle/ +.gradle local.properties # node.js @@ -41,9 +41,4 @@ target/ # Figwheel # -figwheel_server.log -.nrepl-port - -# Mercurial -.hg/ -.hgignore +figwheel_server.log \ No newline at end of file diff --git a/.re-natal b/.re-natal index 0292c842d3..8fd652b4ea 100644 --- a/.re-natal +++ b/.re-natal @@ -1,17 +1,21 @@ { - "name": "Messenger", - "interface": "om-next", - "androidHost": "localhost", + "name": "SyngIm", + "interface": "reagent", + "androidHost": "10.0.3.2", "modules": [ "react-native-contacts", "react-native-invertible-scroll-view", "awesome-phonenumber", "realm", "react-native-loading-spinner-overlay", - "react-native-i18n" + "react-native-i18n", + "realm/react-native", + "react-native-action-button", + "react-native-vector-icons/Ionicons", + "react-native-circle-checkbox", + "react-native-randombytes" ], "imageDirs": [ "images" - ], - "iosHost": "localhost" + ] } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 175e7e973a..e03cc81c3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. This change ### Changed - Add a new arity to `make-widget-async` to provide a different widget shape. -## [0.1.1] - 2016-02-21 +## [0.1.1] - 2016-03-23 ### Changed - Documentation on how to make the widgets. @@ -15,10 +15,10 @@ All notable changes to this project will be documented in this file. This change ### Fixed - Fixed widget maker to keep working when daylight savings switches over. -## 0.1.0 - 2016-02-21 +## 0.1.0 - 2016-03-23 ### Added - Files from the new template. - Widget maker public API - `make-widget-sync`. -[unreleased]: https://github.com/your-name/messenger/compare/0.1.1...HEAD -[0.1.1]: https://github.com/your-name/messenger/compare/0.1.0...0.1.1 +[unreleased]: https://github.com/your-name/syng-im/compare/0.1.1...HEAD +[0.1.1]: https://github.com/your-name/syng-im/compare/0.1.0...0.1.1 diff --git a/README.md b/README.md index 5bee2ef202..19e1fbc53f 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,14 @@ -# messenger +# syng-im -## Setup +A Clojure library designed to ... well, that part is up to you. -https://github.com/drapanjanas/re-natal +## Usage +FIXME -Can be required after pulling changes: +## License -switching between android device +Copyright © 2016 FIXME -https://github.com/drapanjanas/re-natal#switching-between-android-devices - - -Change `server-address` value at `/src/messenger/android/utils.cljs` - -## Issues - -`Requiring unknown module "react"` - -Solution: https://github.com/exponentjs/react-native-invertible-scroll-view/issues/20 +Distributed under the Eclipse Public License either version 1.0 or (at +your option) any later version. diff --git a/android/Messenger.iml b/android/Messenger.iml deleted file mode 100644 index e848486096..0000000000 --- a/android/Messenger.iml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/android/app/app.iml b/android/app/app.iml deleted file mode 100644 index 87cc7efa47..0000000000 --- a/android/app/app.iml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index 0f84db5236..9f152c2e9b 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -26,9 +26,7 @@ import com.android.build.OutputFile * * // whether to bundle JS and assets in another build variant (if configured). * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants - * // The configuration property can be in the following formats - * // 'bundleIn${productFlavor}${buildType}' - * // 'bundleIn${buildType}' + * // The configuration property is in the format 'bundleIn${productFlavor}${buildType}' * // bundleInFreeDebug: true, * // bundleInPaidRelease: true, * // bundleInBeta: true, @@ -62,7 +60,8 @@ import com.android.build.OutputFile apply from: "react.gradle" /** - * Set this to true to create two separate APKs instead of one: + * Set this to true to create three separate APKs instead of one: + * - A universal APK that works on all devices * - An APK that only works on ARM devices * - An APK that only works on x86 devices * The advantage is the size of the APK is reduced by about 4MB. @@ -81,7 +80,7 @@ android { buildToolsVersion "23.0.1" defaultConfig { - applicationId "com.messenger" + applicationId "com.syngim" minSdkVersion 16 targetSdkVersion 22 versionCode 1 @@ -92,9 +91,9 @@ android { } splits { abi { - reset() enable enableSeparateBuildPerCPUArchitecture - universalApk false // If true, also generate a universal APK + universalApk false + reset() include "armeabi-v7a", "x86" } } @@ -120,6 +119,9 @@ android { } dependencies { + compile project(':randombytes') + compile project(':realm') + compile project(':react-native-vector-icons') compile fileTree(dir: "libs", include: ["*.jar"]) compile "com.android.support:appcompat-v7:23.0.1" compile "com.facebook.react:react-native:+" // From node_modules @@ -128,6 +130,5 @@ dependencies { // compile(name:'geth', ext:'aar') compile(group: 'syng-im', name: 'android-geth', version: '1.4.0-201603131817-92d65cf', ext: 'aar') - compile project(":realm") compile fileTree(dir: "node_modules/realm/android/libs", include: ["*.jar"]) } diff --git a/android/app/react.gradle b/android/app/react.gradle index 11a4f8b871..4b43bf910c 100644 --- a/android/app/react.gradle +++ b/android/app/react.gradle @@ -30,20 +30,21 @@ gradle.projectsEvaluated { productFlavors.each { productFlavorName -> buildTypes.each { buildTypeName -> - // Create variant and target names - def targetName = "${productFlavorName.capitalize()}${buildTypeName.capitalize()}" - def targetPath = productFlavorName ? - "${productFlavorName}/${buildTypeName}" : - "${buildTypeName}" + // Create variant and source names + def sourceName = "${buildTypeName}" + def targetName = "${sourceName.capitalize()}" + if (productFlavorName) { + sourceName = "${productFlavorName}${targetName}" + } // React js bundle directories def jsBundleDirConfigName = "jsBundleDir${targetName}" def jsBundleDir = elvisFile(config."$jsBundleDirConfigName") ?: - file("$buildDir/intermediates/assets/${targetPath}") + file("$buildDir/intermediates/assets/${sourceName}") def resourcesDirConfigName = "jsBundleDir${targetName}" def resourcesDir = elvisFile(config."${resourcesDirConfigName}") ?: - file("$buildDir/intermediates/res/merged/${targetPath}") + file("$buildDir/intermediates/res/merged/${sourceName}") def jsBundleFile = file("$jsBundleDir/$bundleAssetName") // Bundle task name for variant @@ -79,9 +80,7 @@ gradle.projectsEvaluated { "--entry-file", entryFile, "--bundle-output", jsBundleFile, "--assets-dest", resourcesDir } - enabled config."bundleIn${targetName}" || - config."bundleIn${buildTypeName.capitalize()}" ?: - targetName.toLowerCase().contains("release") + enabled config."bundleIn${targetName}" ?: targetName.toLowerCase().contains("release") } // Hook bundle${productFlavor}${buildType}JsAndAssets into the android build process diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 6a317b1b0b..c56b2f64b8 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="com.syngim"> diff --git a/syng-im/android/app/src/main/assets/fonts/Entypo.ttf b/android/app/src/main/assets/fonts/Entypo.ttf similarity index 100% rename from syng-im/android/app/src/main/assets/fonts/Entypo.ttf rename to android/app/src/main/assets/fonts/Entypo.ttf diff --git a/syng-im/android/app/src/main/assets/fonts/EvilIcons.ttf b/android/app/src/main/assets/fonts/EvilIcons.ttf similarity index 100% rename from syng-im/android/app/src/main/assets/fonts/EvilIcons.ttf rename to android/app/src/main/assets/fonts/EvilIcons.ttf diff --git a/syng-im/android/app/src/main/assets/fonts/FontAwesome.ttf b/android/app/src/main/assets/fonts/FontAwesome.ttf similarity index 100% rename from syng-im/android/app/src/main/assets/fonts/FontAwesome.ttf rename to android/app/src/main/assets/fonts/FontAwesome.ttf diff --git a/syng-im/android/app/src/main/assets/fonts/Foundation.ttf b/android/app/src/main/assets/fonts/Foundation.ttf similarity index 100% rename from syng-im/android/app/src/main/assets/fonts/Foundation.ttf rename to android/app/src/main/assets/fonts/Foundation.ttf diff --git a/syng-im/android/app/src/main/assets/fonts/Ionicons.ttf b/android/app/src/main/assets/fonts/Ionicons.ttf similarity index 100% rename from syng-im/android/app/src/main/assets/fonts/Ionicons.ttf rename to android/app/src/main/assets/fonts/Ionicons.ttf diff --git a/syng-im/android/app/src/main/assets/fonts/MaterialIcons.ttf b/android/app/src/main/assets/fonts/MaterialIcons.ttf similarity index 100% rename from syng-im/android/app/src/main/assets/fonts/MaterialIcons.ttf rename to android/app/src/main/assets/fonts/MaterialIcons.ttf diff --git a/syng-im/android/app/src/main/assets/fonts/Octicons.ttf b/android/app/src/main/assets/fonts/Octicons.ttf similarity index 100% rename from syng-im/android/app/src/main/assets/fonts/Octicons.ttf rename to android/app/src/main/assets/fonts/Octicons.ttf diff --git a/syng-im/android/app/src/main/assets/fonts/Zocial.ttf b/android/app/src/main/assets/fonts/Zocial.ttf similarity index 100% rename from syng-im/android/app/src/main/assets/fonts/Zocial.ttf rename to android/app/src/main/assets/fonts/Zocial.ttf diff --git a/android/app/src/main/java/com/messenger/MainActivity.java b/android/app/src/main/java/com/messenger/MainActivity.java deleted file mode 100644 index e5716b31ca..0000000000 --- a/android/app/src/main/java/com/messenger/MainActivity.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.messenger; - -import com.facebook.react.ReactActivity; -import com.facebook.react.ReactPackage; -import com.facebook.react.shell.MainReactPackage; -import com.rt2zz.reactnativecontacts.ReactNativeContacts; -import android.os.Bundle; -import android.os.Environment; -import com.github.ethereum.go_ethereum.cmd.Geth; - -import java.util.Arrays; -import java.util.List; -import java.util.Properties; -import java.io.File; - -import com.i18n.reactnativei18n.ReactNativeI18n; -import io.realm.react.RealmReactPackage; - - -public class MainActivity extends ReactActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - // Required for android-16 (???) - System.loadLibrary("gethraw"); - System.loadLibrary("geth"); - - // Required because of crazy APN settings redirecting localhost - Properties properties = System.getProperties(); - properties.setProperty("http.nonProxyHosts", "localhost|127.0.0.1"); - properties.setProperty("https.nonProxyHosts", "localhost|127.0.0.1"); - - File extStore = Environment.getExternalStorageDirectory(); - - final String dataFolder = extStore.exists() ? - extStore.getAbsolutePath() : - getApplicationInfo().dataDir; - - // Launch! - new Thread(new Runnable() { - public void run() { - Geth.run("--bootnodes enode://e2f28126720452aa82f7d3083e49e6b3945502cb94d9750a15e27ee310eed6991618199f878e5fbc7dfa0e20f0af9554b41f491dc8f1dbae8f0f2d37a3a613aa@139.162.13.89:30303 --shh --ipcdisable --nodiscover --rpc --rpcapi db,eth,net,web3,shh --fast --datadir=" + dataFolder); - } - }).start(); - } - - /** - * Returns the name of the main component registered from JavaScript. - * This is used to schedule rendering of the component. - */ - @Override - protected String getMainComponentName() { - return "Messenger"; - } - - /** - * Returns whether dev mode should be enabled. - * This enables e.g. the dev menu. - */ - @Override - protected boolean getUseDeveloperSupport() { - return BuildConfig.DEBUG; - } - - /** - * A list of packages used by the app. If the app uses additional views - * or modules besides the default ones, add more packages here. - */ - @Override - protected List getPackages() { - return Arrays.asList( - new MainReactPackage(), - new ReactNativeContacts(), - new ReactNativeI18n(), - new RealmReactPackage() - ); - } -} diff --git a/syng-im/android/app/src/main/java/com/syngim/MainActivity.java b/android/app/src/main/java/com/syngim/MainActivity.java similarity index 100% rename from syng-im/android/app/src/main/java/com/syngim/MainActivity.java rename to android/app/src/main/java/com/syngim/MainActivity.java diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index 1f2549cd7e..7b66980444 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -1,3 +1,3 @@ - Messenger + SyngIm diff --git a/android/settings.gradle b/android/settings.gradle index 97921ba2db..784925e19a 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,4 +1,4 @@ -rootProject.name = 'Messenger' +rootProject.name = 'SyngIm' include ':app' @@ -8,5 +8,9 @@ project(':react-native-contacts').projectDir = new File(settingsDir, '../node_mo include ':react-native-i18n' project(':react-native-i18n').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-i18n/android') // realm dependency +include ':react-native-vector-icons' +project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android') include ':realm' project(':realm').projectDir = new File(rootProject.projectDir, '../node_modules/realm/android') +include ':randombytes' +project(':randombytes').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-randombytes/app') \ No newline at end of file diff --git a/doc/intro.md b/doc/intro.md index 7819a85571..7a0eb4e81c 100644 --- a/doc/intro.md +++ b/doc/intro.md @@ -1,3 +1,3 @@ -# Introduction to messenger +# Introduction to syng-im TODO: write [great documentation](http://jacobian.org/writing/what-to-write/) diff --git a/env/dev/env/android/main.cljs b/env/dev/env/android/main.cljs index b4a8bf350b..2348604c4a 100644 --- a/env/dev/env/android/main.cljs +++ b/env/dev/env/android/main.cljs @@ -1,16 +1,18 @@ -(ns ^:figwheel-no-load env.android.main - (:require [om.next :as om] - [messenger.android.core :as core] - [messenger.omnext :as omnext] - [figwheel.client :as figwheel :include-macros true])) + (ns ^:figwheel-no-load env.android.main + (:require [reagent.core :as r] + [syng-im.android.core :refer [app-root]] + [figwheel.client :as figwheel :include-macros true] + [syng-im.android.core :as core])) -(enable-console-print!) + (enable-console-print!) + +(def cnt (r/atom 0)) +(defn reloader [] @cnt [app-root]) +(def root-el (r/as-element [reloader])) (figwheel/watch-and-reload - :websocket-url "ws://localhost:3449/figwheel-ws" - :heads-up-display true - :jsload-callback #(om/add-root! omnext/reconciler core/AppRoot 1)) + :websocket-url "ws://10.0.3.2:3449/figwheel-ws" + :heads-up-display true + :jsload-callback #(swap! cnt inc)) -(core/init) - -(def root-el (core/app-root)) \ No newline at end of file +(core/init) \ No newline at end of file diff --git a/env/dev/env/ios/main.cljs b/env/dev/env/ios/main.cljs index dda2c4aeae..748936a414 100644 --- a/env/dev/env/ios/main.cljs +++ b/env/dev/env/ios/main.cljs @@ -1,16 +1,17 @@ -(ns ^:figwheel-no-load env.ios.main - (:require [om.next :as om] - [messenger.ios.core :as core] - [messenger.omnext :as omnext] + (ns ^:figwheel-no-load env.ios.main + (:require [reagent.core :as r] + [syng-im.ios.core :as core] [figwheel.client :as figwheel :include-macros true])) -(enable-console-print!) + (enable-console-print!) + +(def cnt (r/atom 0)) +(defn reloader [] @cnt [core/app-root]) +(def root-el (r/as-element [reloader])) (figwheel/watch-and-reload - :websocket-url "ws://localhost:3449/figwheel-ws" - :heads-up-display true - :jsload-callback #(om/add-root! omnext/reconciler core/AppRoot 1)) + :websocket-url "ws://localhost:3449/figwheel-ws" + :heads-up-display true + :jsload-callback #(swap! cnt inc)) -(core/init) - -(def root-el (core/app-root)) \ No newline at end of file +(core/init) \ No newline at end of file diff --git a/env/prod/env/android/main.cljs b/env/prod/env/android/main.cljs index a669d4b06f..f112100ec7 100644 --- a/env/prod/env/android/main.cljs +++ b/env/prod/env/android/main.cljs @@ -1,4 +1,6 @@ -(ns env.android.main - (:require [messenger.android.core :as core])) + (ns env.android.main + (:require [syng-im.android.core :as core])) + + (core/init) + -(core/init) \ No newline at end of file diff --git a/env/prod/env/ios/main.cljs b/env/prod/env/ios/main.cljs index 970116e404..11392b5e72 100644 --- a/env/prod/env/ios/main.cljs +++ b/env/prod/env/ios/main.cljs @@ -1,4 +1,6 @@ -(ns env.ios.main - (:require [messenger.ios.core :as core])) + (ns env.ios.main + (:require [syng-im.ios.core :as core])) + + (core/init) + -(core/init) \ No newline at end of file diff --git a/syng-im/images/chat.png b/images/chat.png similarity index 100% rename from syng-im/images/chat.png rename to images/chat.png diff --git a/syng-im/images/cljs.png b/images/cljs.png similarity index 100% rename from syng-im/images/cljs.png rename to images/cljs.png diff --git a/syng-im/images/cljs@2x.png b/images/cljs@2x.png similarity index 100% rename from syng-im/images/cljs@2x.png rename to images/cljs@2x.png diff --git a/syng-im/images/cljs@3x.png b/images/cljs@3x.png similarity index 100% rename from syng-im/images/cljs@3x.png rename to images/cljs@3x.png diff --git a/syng-im/images/deliveryfailed.png b/images/deliveryfailed.png similarity index 100% rename from syng-im/images/deliveryfailed.png rename to images/deliveryfailed.png diff --git a/syng-im/images/v.png b/images/v.png similarity index 100% rename from syng-im/images/v.png rename to images/v.png diff --git a/ios/Messenger.xcodeproj/project.pbxproj b/ios/Messenger.xcodeproj/project.pbxproj index 664e54be92..2780f9a5f1 100644 --- a/ios/Messenger.xcodeproj/project.pbxproj +++ b/ios/Messenger.xcodeproj/project.pbxproj @@ -5,7 +5,6 @@ }; objectVersion = 46; objects = { - /* Begin PBXBuildFile section */ 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; @@ -25,6 +24,19 @@ E343FE8E1C96F54100C01DB5 /* libRNI18n.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E343FE8B1C96F4E200C01DB5 /* libRNI18n.a */; }; E343FE8F1C96F54A00C01DB5 /* libRCTContacts.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E343FE841C96F4DA00C01DB5 /* libRCTContacts.a */; }; E343FE911C971D4200C01DB5 /* Geth.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E343FE901C971D4200C01DB5 /* Geth.framework */; }; + 5F301739E81C4A7B92E80915 /* libRNVectorIcons.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1429DFB76DE749D59880DD64 /* libRNVectorIcons.a */; }; + 2171A55FE83747678065F72A /* Entypo.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 93C8E68B46DA4C0A98C39F9D /* Entypo.ttf */; }; + BDF23426F8854AC2A0416A03 /* EvilIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 38E7B297EE0748008056796A /* EvilIcons.ttf */; }; + 221509FA6D5443C0B5215C52 /* FontAwesome.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 2CF9FE7E98A3454D980A0BED /* FontAwesome.ttf */; }; + A33AC3EAFBC04C0B93BD2EC4 /* Foundation.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5A831378BBA14830A9540B8C /* Foundation.ttf */; }; + 1A4121618C94428C9F0DF1FE /* Ionicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5F085711AC4A4BA3887A4655 /* Ionicons.ttf */; }; + 59FCD4F0208949BE80CC72BF /* MaterialIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 0063E967269B49EE80DC3A77 /* MaterialIcons.ttf */; }; + 4452A93C123F4392A99A7719 /* Octicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A74F40BECFF8439FB1F41D8A /* Octicons.ttf */; }; + 1AE91A3E2C1A43EFA90C1CD7 /* Zocial.ttf in Resources */ = {isa = PBXBuildFile; fileRef = BCEC948817B84597AC493C0B /* Zocial.ttf */; }; + 34535F62E77D4A75A25E2981 /* libRNRandomBytes.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2925028DE4684DDAAA7389D7 /* libRNRandomBytes.a */; }; + 97BD21CBE96A4223B253A1E2 /* libRealmReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2B29C182EE0942C889049F91 /* libRealmReact.a */; }; + 22802A9C745148D885F0AA01 /* libc++.tbd in Resources */ = {isa = PBXBuildFile; fileRef = 8003209F13C24D35AABD3933 /* libc++.tbd */; }; + 50EE6BCC6F1A48BBA1BDB893 /* libz.tbd in Resources */ = {isa = PBXBuildFile; fileRef = 313A77B1D7804DBDBE6FF6F5 /* libz.tbd */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -153,6 +165,22 @@ E343FE7F1C96F4DA00C01DB5 /* RCTContacts.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTContacts.xcodeproj; path = "../node_modules/react-native-contacts/ios/RCTContacts.xcodeproj"; sourceTree = ""; }; E343FE851C96F4E200C01DB5 /* RNI18n.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNI18n.xcodeproj; path = "../node_modules/react-native-i18n/RNI18n.xcodeproj"; sourceTree = ""; }; E343FE901C971D4200C01DB5 /* Geth.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Geth.framework; path = target/Frameworks/Geth.framework; sourceTree = ""; }; + F04672B9D3824B768FCF6F71 /* RNVectorIcons.xcodeproj */ = {isa = PBXFileReference; name = "RNVectorIcons.xcodeproj"; path = "../node_modules/react-native-vector-icons/RNVectorIcons.xcodeproj"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; }; + 1429DFB76DE749D59880DD64 /* libRNVectorIcons.a */ = {isa = PBXFileReference; name = "libRNVectorIcons.a"; path = "libRNVectorIcons.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; + 93C8E68B46DA4C0A98C39F9D /* Entypo.ttf */ = {isa = PBXFileReference; name = "Entypo.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/Entypo.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; + 38E7B297EE0748008056796A /* EvilIcons.ttf */ = {isa = PBXFileReference; name = "EvilIcons.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; + 2CF9FE7E98A3454D980A0BED /* FontAwesome.ttf */ = {isa = PBXFileReference; name = "FontAwesome.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; + 5A831378BBA14830A9540B8C /* Foundation.ttf */ = {isa = PBXFileReference; name = "Foundation.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/Foundation.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; + 5F085711AC4A4BA3887A4655 /* Ionicons.ttf */ = {isa = PBXFileReference; name = "Ionicons.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/Ionicons.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; + 0063E967269B49EE80DC3A77 /* MaterialIcons.ttf */ = {isa = PBXFileReference; name = "MaterialIcons.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/MaterialIcons.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; + A74F40BECFF8439FB1F41D8A /* Octicons.ttf */ = {isa = PBXFileReference; name = "Octicons.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/Octicons.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; + BCEC948817B84597AC493C0B /* Zocial.ttf */ = {isa = PBXFileReference; name = "Zocial.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/Zocial.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; + 06F26555B4054594966B6B08 /* RNRandomBytes.xcodeproj */ = {isa = PBXFileReference; name = "RNRandomBytes.xcodeproj"; path = "../node_modules/react-native-randombytes/RNRandomBytes.xcodeproj"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; }; + 2925028DE4684DDAAA7389D7 /* libRNRandomBytes.a */ = {isa = PBXFileReference; name = "libRNRandomBytes.a"; path = "libRNRandomBytes.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; + 0D4A52AE301842E1B2533BD3 /* RealmReact.xcodeproj */ = {isa = PBXFileReference; name = "RealmReact.xcodeproj"; path = "../node_modules/realm/react-native/ios/RealmReact.xcodeproj"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; }; + 2B29C182EE0942C889049F91 /* libRealmReact.a */ = {isa = PBXFileReference; name = "libRealmReact.a"; path = "libRealmReact.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; + 8003209F13C24D35AABD3933 /* libc++.tbd */ = {isa = PBXFileReference; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; fileEncoding = undefined; lastKnownFileType = sourcecode.text-based-dylib-definition; explicitFileType = undefined; includeInIndex = 0; }; + 313A77B1D7804DBDBE6FF6F5 /* libz.tbd */ = {isa = PBXFileReference; name = "libz.tbd"; path = "usr/lib/libz.tbd"; sourceTree = SDKROOT; fileEncoding = undefined; lastKnownFileType = sourcecode.text-based-dylib-definition; explicitFileType = undefined; includeInIndex = 0; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -180,6 +208,11 @@ 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, + 5F301739E81C4A7B92E80915 /* libRNVectorIcons.a in Frameworks */, + 34535F62E77D4A75A25E2981 /* libRNRandomBytes.a in Frameworks */, + 97BD21CBE96A4223B253A1E2 /* libRealmReact.a in Frameworks */, + 22802A9C745148D885F0AA01 /* libc++.tbd in Resources */, + 50EE6BCC6F1A48BBA1BDB893 /* libz.tbd in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -304,6 +337,9 @@ 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, + F04672B9D3824B768FCF6F71 /* RNVectorIcons.xcodeproj */, + 06F26555B4054594966B6B08 /* RNRandomBytes.xcodeproj */, + 0D4A52AE301842E1B2533BD3 /* RealmReact.xcodeproj */, ); name = Libraries; sourceTree = ""; @@ -324,6 +360,7 @@ 832341AE1AAA6A7D00B99B32 /* Libraries */, 00E356EF1AD99517003FC87E /* MessengerTests */, 83CBBA001A601CBA00E9B192 /* Products */, + A72CA0FB822D450E98649ACB /* Resources */, ); indentWidth = 2; sourceTree = ""; @@ -359,10 +396,28 @@ isa = PBXGroup; children = ( E343FE901C971D4200C01DB5 /* Geth.framework */, + 8003209F13C24D35AABD3933 /* libc++.tbd */, + 313A77B1D7804DBDBE6FF6F5 /* libz.tbd */, ); name = Frameworks; sourceTree = ""; }; + A72CA0FB822D450E98649ACB /* Resources */ = { + isa = PBXGroup; + children = ( + 93C8E68B46DA4C0A98C39F9D /* Entypo.ttf */, + 38E7B297EE0748008056796A /* EvilIcons.ttf */, + 2CF9FE7E98A3454D980A0BED /* FontAwesome.ttf */, + 5A831378BBA14830A9540B8C /* Foundation.ttf */, + 5F085711AC4A4BA3887A4655 /* Ionicons.ttf */, + 0063E967269B49EE80DC3A77 /* MaterialIcons.ttf */, + A74F40BECFF8439FB1F41D8A /* Octicons.ttf */, + BCEC948817B84597AC493C0B /* Zocial.ttf */, + ); + name = Resources; + path = ""; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -408,7 +463,7 @@ 83CBB9F71A601CBA00E9B192 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0720; + LastUpgradeCheck = 720; ORGANIZATIONNAME = Facebook; TargetAttributes = { 00E356ED1AD99517003FC87E = { @@ -594,6 +649,14 @@ files = ( 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, + 2171A55FE83747678065F72A /* Entypo.ttf in Resources */, + BDF23426F8854AC2A0416A03 /* EvilIcons.ttf in Resources */, + 221509FA6D5443C0B5215C52 /* FontAwesome.ttf in Resources */, + A33AC3EAFBC04C0B93BD2EC4 /* Foundation.ttf in Resources */, + 1A4121618C94428C9F0DF1FE /* Ionicons.ttf in Resources */, + 59FCD4F0208949BE80CC72BF /* MaterialIcons.ttf in Resources */, + 4452A93C123F4392A99A7719 /* Octicons.ttf in Resources */, + 1AE91A3E2C1A43EFA90C1CD7 /* Zocial.ttf in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -675,6 +738,11 @@ PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Messenger.app/Messenger"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + ); }; name = Debug; }; @@ -693,6 +761,11 @@ PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Messenger.app/Messenger"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + ); }; name = Release; }; @@ -709,6 +782,9 @@ "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../node_modules/react-native/React/**", + "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager", + "$(SRCROOT)/../node_modules/react-native-randombytes", + "$(SRCROOT)/../node_modules/realm/src/**", ); INFOPLIST_FILE = Messenger/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -730,6 +806,9 @@ "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../node_modules/react-native/React/**", + "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager", + "$(SRCROOT)/../node_modules/react-native-randombytes", + "$(SRCROOT)/../node_modules/realm/src/**", ); INFOPLIST_FILE = Messenger/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -778,6 +857,9 @@ "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../node_modules/react-native/React/**", + "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager", + "$(SRCROOT)/../node_modules/react-native-randombytes", + "$(SRCROOT)/../node_modules/realm/src/**", ); IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = YES; @@ -818,6 +900,9 @@ "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../node_modules/react-native/React/**", + "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager", + "$(SRCROOT)/../node_modules/react-native-randombytes", + "$(SRCROOT)/../node_modules/realm/src/**", ); IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = NO; diff --git a/package.json b/package.json index 5d383198ef..f069c032a4 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "Messenger", + "name": "SyngIm", "version": "0.0.1", "private": true, "scripts": { @@ -8,10 +8,14 @@ "dependencies": { "awesome-phonenumber": "^1.0.12", "react-native": "^0.22.0", + "react-native-action-button": "^1.1.3", + "react-native-circle-checkbox": "^0.1.3", "react-native-contacts": "^0.2.1", "react-native-i18n": "0.0.8", "react-native-invertible-scroll-view": "^0.2.0", "react-native-loading-spinner-overlay": "0.0.6", - "realm": "^0.10.0" + "react-native-randombytes": "^2.0.0", + "react-native-vector-icons": "^1.3.3", + "realm": "^0.11.0" } } diff --git a/project.clj b/project.clj index e03925f130..37ed02bf72 100644 --- a/project.clj +++ b/project.clj @@ -1,13 +1,15 @@ -(defproject messenger "0.1.0-SNAPSHOT" +(defproject syng-im "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "http://example.com/FIXME" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [[org.clojure/clojure "1.7.0"] [org.clojure/clojurescript "1.7.170"] - [org.omcljs/om "1.0.0-alpha30" :exclusions [cljsjs/react cljsjs/react-dom]] - [natal-shell "0.1.6"] - [syng-im/protocol "0.1.1"]] + [reagent "0.5.1" :exclusions [cljsjs/react]] + [re-frame "0.6.0"] + [prismatic/schema "1.0.4"] + [syng-im/protocol "0.1.1"] + [natal-shell "0.1.6"]] :plugins [[lein-cljsbuild "1.1.1"] [lein-figwheel "0.5.0-2"]] :clean-targets ["target/" "index.ios.js" "index.android.js"] @@ -16,32 +18,30 @@ ["with-profile" "prod" "cljsbuild" "once" "ios"] ["with-profile" "prod" "cljsbuild" "once" "android"]]} :figwheel {:nrepl-port 7888} - :profiles - {:dev {:dependencies [[figwheel-sidecar "0.5.0-2"] - [com.cemerick/piggieback "0.2.1"]] - :source-paths ["src" "env/dev"] - :cljsbuild {:builds - {:ios {:source-paths ["src" "env/dev"] - :figwheel true - :compiler {:output-to "target/ios/not-used.js" - :main "env.ios.main" - :output-dir "target/ios" - :optimizations :none}} - :android {:source-paths ["src" "env/dev"] - :figwheel true - :compiler {:output-to "target/android/not-used.js" - :main "env.android.main" - :output-dir "target/android" - :optimizations :none}}}} - :repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}} - :prod {:cljsbuild {:builds - {:ios {:source-paths ["src" "env/prod"] - :compiler {:output-to "index.ios.js" - :main "env.ios.main" - :output-dir "target/ios" - :optimizations :simple}} - :android {:source-paths ["src" "env/prod"] - :compiler {:output-to "index.android.js" - :main "env.android.main" - :output-dir "target/android" - :optimizations :simple}}}}}}) + :profiles {:dev {:dependencies [[figwheel-sidecar "0.5.0-2"] + [com.cemerick/piggieback "0.2.1"]] + :source-paths ["src" "env/dev"] + :cljsbuild {:builds {:ios {:source-paths ["src" "env/dev"] + :figwheel true + :compiler {:output-to "target/ios/not-used.js" + :main "env.ios.main" + :output-dir "target/ios" + :optimizations :none}} + :android {:source-paths ["src" "env/dev"] + :figwheel true + :compiler {:output-to "target/android/not-used.js" + :main "env.android.main" + :output-dir "target/android" + :optimizations :none}}}} + :repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}} + :prod {:cljsbuild {:builds {:ios {:source-paths ["src" "env/prod"] + :compiler {:output-to "index.ios.js" + :main "env.ios.main" + :output-dir "target/ios" + :optimizations :simple}} + :android {:source-paths ["src" "env/prod"] + :compiler {:output-to "index.android.js" + :main "env.android.main" + :output-dir "target/android" + :optimizations :simple}}}} + }}) \ No newline at end of file diff --git a/src/cljsjs/react/dom.cljs b/src/cljsjs/react/dom.cljs deleted file mode 100644 index 3c69f0090f..0000000000 --- a/src/cljsjs/react/dom.cljs +++ /dev/null @@ -1 +0,0 @@ -(ns cljsjs.react.dom) \ No newline at end of file diff --git a/src/messenger/android/core.cljs b/src/messenger/android/core.cljs deleted file mode 100644 index 36aecbaf64..0000000000 --- a/src/messenger/android/core.cljs +++ /dev/null @@ -1,79 +0,0 @@ -(ns messenger.android.core - (:require-macros - [natal-shell.components :refer [navigator view text image touchable-highlight - list-view toolbar-android]] - [natal-shell.data-source :refer [data-source clone-with-rows]] - [natal-shell.back-android :refer [add-event-listener remove-event-listener]] - [natal-shell.core :refer [with-error-view]] - [natal-shell.alert :refer [alert]]) - (:require [om.next :as om :refer-macros [defui]] - [re-natal.support :as sup] - [messenger.omnext :as omnext] - [messenger.state :as state] - [messenger.utils.utils :refer [log toast]] - [messenger.android.login :refer [login Login]] - [messenger.comm.pubsub :as pubsub] - [messenger.comm.intercom :as intercom :refer [load-user-phone-number]] - [messenger.protocol.protocol-handler :refer [make-handler]] - [messenger.init :refer [init-simple-store]] - [messenger.components.chat.chat :as chat] - [syng-im.protocol.api :refer [init-protocol]] - [syng-im.utils.logging :as log] - [messenger.components.iname :as in] - [messenger.models.navigation :as n] - [messenger.components.contact-list.contact-list :refer [ContactList contact-list]])) - - -(def app-registry (.-AppRegistry js/React)) - -(def back-button-handler-atom (atom {:nav nil - :handler nil})) - -(defn init-back-button-handler! [nav] - (let [back-button-handler @back-button-handler-atom] - (when (not= (:nav back-button-handler) nav) - (remove-event-listener "hardwareBackPress" (:handler back-button-handler)) - (let [new-listener (fn [] - (binding [state/*nav-render* false] - (when (< 1 (.-length (.getCurrentRoutes nav))) - (.pop nav) - true)))] - (reset! back-button-handler-atom {:nav nav - :handler new-listener}) - (add-event-listener "hardwareBackPress" new-listener))))) - -(defui AppRoot - static om/IQuery - (query [this] - (let [component (n/current-screen-class)] - [{(in/get-name component) (om/get-query component)}])) - Object - (render [this] - (log/debug "APPROOT Rendering") - (navigator - {:initialRoute {:component contact-list} - :renderScene (fn [route nav] - (log/debug "RENDER SCENE") - (when state/*nav-render* - (init-back-button-handler! nav) - (let [{:keys [component]} (js->clj route :keywordize-keys true) - props (om/props this) - props (om/computed props {:nav nav})] - (component props))))}))) - -;; TODO to service? -(swap! state/app-state assoc :contacts-ds - (data-source {:rowHasChanged (fn [row1 row2] - (not= row1 row2))})) - -(defonce RootNode (sup/root-node! 1)) -(defonce app-root (om/factory RootNode)) - -(defn init [] - (n/set-current-screen-class ContactList) - (init-simple-store) - (pubsub/setup-pub-sub) - (init-protocol (make-handler)) - (load-user-phone-number) - (om/add-root! omnext/reconciler AppRoot 1) - (.registerComponent app-registry "Messenger" (fn [] app-root))) diff --git a/src/messenger/android/login.cljs b/src/messenger/android/login.cljs deleted file mode 100644 index a01d89538c..0000000000 --- a/src/messenger/android/login.cljs +++ /dev/null @@ -1,83 +0,0 @@ -(ns messenger.android.login - (:require-macros - [natal-shell.components :refer [view text image touchable-highlight list-view - toolbar-android text-input]] - [natal-shell.core :refer [with-error-view]]) - (:require [om.next :as om :refer-macros [defui]] - [re-natal.support :as sup] - [messenger.state :as state] - [messenger.comm.intercom :as intercom :refer [set-user-phone-number]] - [messenger.utils.utils :refer [log toast http-post]] - [messenger.utils.phone-number :refer [format-phone-number]] - [messenger.utils.resources :as res] - [messenger.components.spinner :refer [spinner]] - [messenger.android.sign-up-confirm :refer [sign-up-confirm]] - [messenger.constants :refer [ethereum-rpc-url]] - [messenger.components.iname :as in])) - -(def nav-atom (atom nil)) - -(defn show-confirm-view [] - (swap! state/app-state assoc :loading false) - (intercom/show-signup-confirm @nav-atom)) - -(defn sign-up [] - (swap! state/app-state assoc :loading true) - (let [app-state (state/state) - phone-number (:user-phone-number app-state) - whisper-identity (:public (:user-identity app-state))] - (intercom/sign-up phone-number whisper-identity show-confirm-view))) - -(defn update-phone-number [value] - (let [formatted (format-phone-number value)] - (set-user-phone-number formatted))) - -(defui Login - static in/IName - (get-name [this] - :login/login) - static om/IQuery - (query [this] - '[:user-phone-number :user-identity :loading]) - Object - (render [this] - (let [{{:keys [user-phone-number user-identity loading]} :login/login} (om/props this) - {:keys [nav]} (om/get-computed this)] - (reset! nav-atom nav) - (view - {:style {:flex 1}} - (view - {:style {:flex 1 - :backgroundColor "white"}} - (toolbar-android {:logo res/logo-icon - :title "Login" - :titleColor "#4A5258" - :style {:backgroundColor "white" - :height 56 - :elevation 2}}) - (view {:style { ;; :alignItems "center" - }} - (text-input {:underlineColorAndroid "#9CBFC0" - :placeholder "Enter your phone number" - :keyboardType "phone-pad" - :onChangeText (fn [value] - (update-phone-number value)) - :style {:flex 1 - :marginHorizontal 18 - :lineHeight 42 - :fontSize 14 - :fontFamily "Avenir-Roman" - :color "#9CBFC0"}} - user-phone-number) - (touchable-highlight {:onPress #(sign-up) - :style {:alignSelf "center" - :borderRadius 7 - :backgroundColor "#E5F5F6" - :width 100}} - (text {:style {:marginVertical 10 - :textAlign "center"}} - "Sign up")))) - (when (or loading (not user-identity)) - (spinner {:visible true})))))) - -(def login (om/factory Login)) diff --git a/src/messenger/android/sign_up_confirm.cljs b/src/messenger/android/sign_up_confirm.cljs deleted file mode 100644 index b5d3e7f5b3..0000000000 --- a/src/messenger/android/sign_up_confirm.cljs +++ /dev/null @@ -1,108 +0,0 @@ -(ns messenger.android.sign-up-confirm - (:require-macros - [natal-shell.components :refer [view text image touchable-highlight list-view - toolbar-android text-input]] - [natal-shell.async-storage :refer [get-item set-item]] - [natal-shell.core :refer [with-error-view]] - [natal-shell.alert :refer [alert]]) - (:require [om.next :as om :refer-macros [defui]] - [re-natal.support :as sup] - [messenger.state :as state] - [messenger.utils.utils :refer [log toast]] - [messenger.utils.resources :as res] - [messenger.components.spinner :refer [spinner]] - [messenger.components.contact-list.contact-list :refer [contact-list]] - [messenger.comm.intercom :as intercom :refer [set-confirmation-code]] - [messenger.components.iname :as in])) - -(def nav-atom (atom nil)) - -(defn show-home-view [] - (swap! state/app-state assoc :loading false) - (intercom/show-contacts @nav-atom)) - -(defn sync-contacts [] - (intercom/sync-contacts show-home-view)) - -(defn on-send-code-response [body] - (log body) - (toast (if (:confirmed body) - "Confirmed" - "Wrong code")) - (when (:confirmed body) - ;; TODO user action required - (sync-contacts))) - -(defn code-valid? [code] - (= 4 (count code))) - -(defn send-code [code] - (when (code-valid? code) - (swap! state/app-state assoc :loading true) - (intercom/sign-up-confirm code on-send-code-response))) - -(defn update-code [value] - (let [formatted value] - (set-confirmation-code formatted))) - -(defui SignUpConfirm - static in/IName - (get-name [this] - :signup/confirm) - static om/IQuery - (query [this] - '[:confirmation-code :loading]) - Object - (render - [this] - (let [{{:keys [confirmation-code loading]} :signup/confirm} (om/props this) - {:keys [nav]} (om/get-computed this)] - (reset! nav-atom nav) - (view - {:style {:flex 1}} - (view - {:style {:flex 1 - :backgroundColor "white"}} - (toolbar-android {:logo res/logo-icon - :title "Confirm" - :titleColor "#4A5258" - :style {:backgroundColor "white" - :height 56 - :elevation 2}}) - (view {} - (text-input {:underlineColorAndroid "#9CBFC0" - :placeholder "Enter confirmation code" - :keyboardType "number-pad" - :maxLength 4 - :onChangeText (fn [value] - (update-code value)) - :style {:flex 1 - :marginHorizontal 18 - :lineHeight 42 - :fontSize 14 - :fontFamily "Avenir-Roman" - :color "#9CBFC0"}} - confirmation-code) - (if (code-valid? confirmation-code) - (touchable-highlight - {:onPress #(send-code confirmation-code) - :style {:alignSelf "center" - :borderRadius 7 - :backgroundColor "#E5F5F6" - - :width 100}} - (text {:style {:marginVertical 10 - :textAlign "center"}} - "Confirm")) - (view - {:style {:alignSelf "center" - :borderRadius 7 - :backgroundColor "#AAB2B2" - :width 100}} - (text {:style {:marginVertical 10 - :textAlign "center"}} - "Confirm"))))) - (when loading - (spinner {:visible true})))))) - -(def sign-up-confirm (om/factory SignUpConfirm)) diff --git a/src/messenger/comm/intercom.cljs b/src/messenger/comm/intercom.cljs deleted file mode 100644 index 4982716565..0000000000 --- a/src/messenger/comm/intercom.cljs +++ /dev/null @@ -1,75 +0,0 @@ -(ns messenger.comm.intercom - (:require [cljs.core.async :as async :refer [put!]] - [messenger.state :refer [state - pub-sub-publisher]] - [syng-im.utils.logging :as log])) - -(defn publish! [topic message] - (let [publisher (->> (state) - (pub-sub-publisher))] - (put! publisher [topic message]))) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; user data - -(defn set-user-phone-number [phone-number] - (publish! :service [:user-data :user-data/set-phone-number phone-number])) - -(defn save-user-phone-number [phone-number] - (publish! :service [:user-data :user-data/save-phone-number phone-number])) - -(defn load-user-phone-number [] - ;; :service [service_name action_id args_map] - (publish! :service [:user-data :user-data/load-phone-number nil])) - -(defn set-confirmation-code [confirmation-code] - (publish! :service [:user-data :user-data/set-confirmation-code confirmation-code])) - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; server - -(defn sign-up [phone-number whisper-identity handler] - (publish! :service [:server :server/sign-up {:phone-number phone-number - :whisper-identity whisper-identity - :handler handler}])) - -(defn sign-up-confirm [confirmation-code handler] - (publish! :service [:server :server/sign-up-confirm - {:confirmation-code confirmation-code - :handler handler}])) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; contacts - -(defn load-syng-contacts [] - (publish! :service [:contacts :contacts/load-syng-contacts nil])) - -(defn sync-contacts [handler] - (publish! :service [:contacts :contacts/sync-contacts handler])) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; protocol - -(defn protocol-initialized [identity] - (publish! :service [:protocol :protocol/initialized {:identity identity}])) - -(defn save-new-msg [msg] - (publish! :service [:protocol :protocol/save-new-msg {:msg msg}])) - -(defn send-msg [chat-id text] - (publish! :service [:protocol :protocol/send-msg {:chat-id chat-id - :text text}])) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; navigate-to - -(defn show-chat [navigator chat-id] - (publish! :service [:navigate-to :scene/chat {:chat-id chat-id - :navigator navigator}])) - -(defn show-signup-confirm [navigator] - (publish! :service [:navigate-to :scene/signup-confirm {:navigator navigator}])) - -(defn show-contacts [navigator] - (publish! :service [:navigate-to :scene/contacts {:navigator navigator}])) diff --git a/src/messenger/comm/pubsub.cljs b/src/messenger/comm/pubsub.cljs deleted file mode 100644 index 7ddc74b640..0000000000 --- a/src/messenger/comm/pubsub.cljs +++ /dev/null @@ -1,33 +0,0 @@ -(ns messenger.comm.pubsub - (:require-macros [cljs.core.async.macros :refer [go alt!]]) - (:require [cljs.core.async :as async :refer [chan pub sub]] - [messenger.state :refer [state - pub-sub-publisher - app-state - pub-sub-path]] - [messenger.comm.services :refer [services-handler]] - [messenger.utils.event :refer [handle-channel-events]])) - -(defn service-id [message] - (first message)) - -(defn payload [message] - (rest message)) - -(defn subscribe-handler [publication topic handler] - (let [chn (chan)] - (sub publication topic chn) - (handle-channel-events chn (fn [_topic message] - (handler app-state - (service-id message) - (payload message)))))) - -(defn setup-publication! [app-state] - (let [publisher (pub-sub-publisher @app-state) - publication (pub publisher first)] - (swap! app-state assoc-in pub-sub-path publication) - publication)) - -(defn setup-pub-sub [] - (-> (setup-publication! app-state) - (subscribe-handler :service services-handler))) \ No newline at end of file diff --git a/src/messenger/comm/services.cljs b/src/messenger/comm/services.cljs deleted file mode 100644 index aeb5f2d5e9..0000000000 --- a/src/messenger/comm/services.cljs +++ /dev/null @@ -1,35 +0,0 @@ -(ns messenger.comm.services - (:require - [syng-im.utils.logging :as log] - [messenger.services.user-data :refer [user-data-handler]] - [messenger.services.protocol :refer [protocol-handler]] - [messenger.services.server :refer [server-handler]] - [messenger.services.contacts :refer [contacts-handler]] - [messenger.services.navigate-to :refer [navigate-to-handler]])) - -(defmulti service (fn [state service-id args] - service-id)) - -(defmethod service :user-data - [state service-id args] - (user-data-handler state args)) - -(defmethod service :server - [state service-id args] - (server-handler state args)) - -(defmethod service :contacts - [state service-id args] - (contacts-handler state args)) - -(defmethod service :protocol - [state service-id args] - (protocol-handler state args)) - -(defmethod service :navigate-to - [state service-id args] - (navigate-to-handler state args)) - -(defn services-handler [state service-id args] - (log/info "handling " service-id " args = " args) - (service state service-id args)) diff --git a/src/messenger/components/chat/chat.cljs b/src/messenger/components/chat/chat.cljs deleted file mode 100644 index f1a4cd2e50..0000000000 --- a/src/messenger/components/chat/chat.cljs +++ /dev/null @@ -1,91 +0,0 @@ -(ns messenger.components.chat.chat - (:require-macros - [natal-shell.components :refer [view list-view toolbar-android]] - [natal-shell.data-source :refer [data-source clone-with-rows]]) - (:require [om.next :as om :refer-macros [defui]] - [messenger.utils.resources :as res] - [messenger.components.invertible-scroll-view :refer [invertible-scroll-view]] - [messenger.components.chat.message :refer [message]] - [messenger.components.chat.new-message :refer [new-message NewMessage]] - [messenger.state :as state] - [syng-im.utils.logging :as log] - [messenger.components.iname :as in] - [messenger.omnext :as omnext])) - -;(defn generate-message [n] -; {:id n -; :type (if (= (rem n 4) 3) -; :audio -; :text) -; :body (if (= (rem n 3) 0) -; (apply str n "." (repeat 5 " This is a text.")) -; (str n ". This is a text.")) -; :outgoing (< (rand) 0.5) -; :delivery-status (if (< (rand) 0.5) :delivered :seen) -; :date "TODAY" -; :new-day (= (rem n 3) 0)}) -; -;(defn generate-messages [n] -; (map generate-message (range 1 (inc n)))) - -;(defn load-messages [] -; (clone-with-rows (data-source {:rowHasChanged (fn [row1 row2] -; (not= row1 row2))}) -; (vec (generate-messages 100)))) -; - -(defn to-datasource [msgs] - (-> (data-source {:rowHasChanged (fn [row1 row2] - (not= row1 row2))}) - (clone-with-rows msgs))) - -(defn nav-pop [nav] - (binding [state/*nav-render* false] - (.pop nav))) - -(defn render-row [row section-id row-id] - (message (js->clj row :keywordize-keys true))) - -(defui Chat - static in/IName - (get-name [this] - :chat/chat) - static om/IQuery - (query [this] - `[:chat/messages ~@(om/get-query NewMessage)]) - Object - (componentDidMount [this] - (om.next.protocols/reindex! omnext/reconciler)) - (render - [this] - (let [{:keys [nav]} (om/get-computed this) - {{messages :chat/messages - chat-id :chat/chat-id} :chat/chat} (om/props this) - _ (log/debug "messages=" messages) - messages-ds (when messages - (to-datasource messages))] - (view {:style {:flex 1 - :backgroundColor "white"}} - (toolbar-android {:logo res/logo-icon - :title "Chat name" - :titleColor "#4A5258" - :subtitle "Last seen just now" - :subtitleColor "#AAB2B2" - :navIcon res/nav-back-icon - :style {:backgroundColor "white" - :height 56 - :elevation 2} - :onIconClicked (fn [] - (nav-pop nav))}) - (when messages-ds - (list-view {:dataSource messages-ds - :renderScrollComponent - (fn [props] - (invertible-scroll-view nil)) - :renderRow render-row - :style {:backgroundColor "white"}})) - - (new-message {:chat-id chat-id}))))) - -(def chat (om/factory Chat)) - diff --git a/src/messenger/components/chat/message.cljs b/src/messenger/components/chat/message.cljs deleted file mode 100644 index 30d5595486..0000000000 --- a/src/messenger/components/chat/message.cljs +++ /dev/null @@ -1,107 +0,0 @@ -(ns messenger.components.chat.message - (:require-macros - [natal-shell.components :refer [view text image]]) - (:require [om.next :as om :refer-macros [defui]] - [messenger.utils.resources :as res] - [messenger.constants :refer [text-content-type]])) - -(defui Message - static om/Ident - (ident [this {:keys [msg-id]}] - [:message/by-id msg-id]) - static om/IQuery - (query [this] - '[:msg-id :content :content-type :outgoing :delivery-status :date :new-day]) - Object - (render - [this] - (let [{:keys [msg-id content content-type outgoing delivery-status date new-day] :as props} (om/props this)] - (view {:paddingHorizontal 15} - ;;; date - (when new-day - (text {:style {:marginVertical 10 - :fontFamily "Avenir-Roman" - :fontSize 11 - :color "#AAB2B2" - :letterSpacing 1 - :lineHeight 15 - :textAlign "center" - :opacity 0.8}} - date)) - ;;; body - (view {:style (merge {:flexDirection "column" - :width 260 - :marginVertical 5} - (if outgoing - {:alignSelf "flex-end" - :alignItems "flex-end"} - {:alignSelf "flex-start" - :alignItems "flex-start"}))} - (view {:style (merge {:borderRadius 6} - (if (= content-type text-content-type) - {:paddingVertical 12 - :paddingHorizontal 16} - {:paddingVertical 14 - :paddingHorizontal 10}) - (if outgoing - {:backgroundColor "#D3EEEF"} - {:backgroundColor "#FBF6E3"}))} - (if (= content-type text-content-type) - (text {:style {:fontSize 14 - :fontFamily "Avenir-Roman" - :color "#4A5258"}} - content) - ;;; audio - (view {:style {:flexDirection "row" - :alignItems "center"}} - (view {:style {:width 33 - :height 33 - :borderRadius 50 - :elevation 1}} - (image {:source res/play - :style {:width 33 - :height 33}})) - (view {:style {:marginTop 10 - :marginLeft 10 - :width 120 - :height 26 - :elevation 1}} - (view {:style {:position "absolute" - :top 4 - :width 120 - :height 2 - :backgroundColor "#EC7262"}}) - (view {:style {:position "absolute" - :left 0 - :top 0 - :width 2 - :height 10 - :backgroundColor "#4A5258"}}) - (text {:style {:position "absolute" - :left 1 - :top 11 - :fontFamily "Avenir-Roman" - :fontSize 11 - :color "#4A5258" - :letterSpacing 1 - :lineHeight 15}} - "03:39"))))) - ;;; delivery status - (when (and outgoing delivery-status) - (view {:style {:flexDirection "row" - :marginTop 2}} - (image {:source (if (= (keyword delivery-status) :seen) - res/seen-icon - res/delivered-icon) - :style {:marginTop 6 - :opacity 0.6}}) - (text {:style {:fontFamily "Avenir-Roman" - :fontSize 11 - :color "#AAB2B2" - :opacity 0.8 - :marginLeft 5}} - (if (= (keyword delivery-status) :seen) - "Seen" - "Delivered"))))))))) - -(def message (om/factory Message {:keyfn :msg-id})) \ No newline at end of file diff --git a/src/messenger/components/chat/new_message.cljs b/src/messenger/components/chat/new_message.cljs deleted file mode 100644 index 5dd56a685d..0000000000 --- a/src/messenger/components/chat/new_message.cljs +++ /dev/null @@ -1,60 +0,0 @@ -(ns messenger.components.chat.new-message - (:require-macros - [natal-shell.components :refer [view image text-input]]) - (:require [om.next :as om :refer-macros [defui]] - [messenger.utils.resources :as res] - [syng-im.utils.logging :as log] - [messenger.utils.state :refer [from-state]] - [messenger.comm.intercom :refer [send-msg]])) - -(def local-state (atom {})) - -(defui NewMessage - static om/IQuery - (query [this] - '[:chat/chat-id]) - Object - (render [this] - (view {:style {:flexDirection "row" - :margin 10 - :height 40 - :backgroundColor "#E5F5F6" - :borderRadius 5}} - (image {:source res/mic - :style {:marginTop 11 - :marginLeft 14 - :width 13 - :height 20}}) - (text-input {:underlineColorAndroid "#9CBFC0" - :style {:flex 1 - :marginLeft 18 - :lineHeight 42 - :fontSize 14 - :fontFamily "Avenir-Roman" - :color "#9CBFC0"} - :autoFocus true - :placeholder "Enter your message here" - :value (from-state this :text) - :onChangeText (fn [text] - ;(log/debug (with-out-str (pr (js->clj (om/props this)))) (-> (om/props this) :chat-id)) - ;(om/set-state! this (clj->js {:text text})) - (swap! local-state assoc :text text) - ) - :onSubmitEditing (fn [e] - (let [chat-id (-> (om/props this) :chat-id) - ;text (from-state this :text) - text (get @local-state :text)] - ;(om/set-state! this (clj->js {:text nil})) - (send-msg chat-id text)))}) - (image {:source res/smile - :style {:marginTop 11 - :marginRight 12 - :width 18 - :height 18}}) - (image {:source res/att - :style {:marginTop 14 - :marginRight 16 - :width 17 - :height 14}})))) - -(def new-message (om/factory NewMessage)) diff --git a/src/messenger/components/contact_list/contact.cljs b/src/messenger/components/contact_list/contact.cljs deleted file mode 100644 index 1e832e6b07..0000000000 --- a/src/messenger/components/contact_list/contact.cljs +++ /dev/null @@ -1,120 +0,0 @@ -(ns messenger.components.contact-list.contact - (:require-macros - [natal-shell.components :refer [view text image touchable-highlight]]) - (:require [om.next :as om :refer-macros [defui]] - [messenger.state :as state] - [messenger.utils.utils :refer [log toast http-post]] - [messenger.utils.resources :as res] - [messenger.comm.intercom :as intercom :refer [show-chat]] - [messenger.components.chat.chat :refer [chat]])) - -(def react-native-contacts (js/require "react-native-contacts")) - -(defui Contact - static om/Ident - (ident [this {:keys [name]}] - [:contact/by-name name]) - static om/IQuery - (query [this] - '[:name :photo-path :delivery-status :datetime :new-messages-count :online :whisper-identity]) - Object - (render [this] - (let [{:keys [name photo-path delivery-status datetime new-messages-count online whisper-identity]} - (dissoc (om/props this) :om.next/computed) - {:keys [nav]} (om/get-computed this)] - (touchable-highlight - {:onPress (fn [] - (show-chat nav whisper-identity))} - (view {:style {:flexDirection "row" - :marginTop 5 - :marginBottom 5 - :paddingLeft 15 - :paddingRight 15 - :height 75}} - (view {:width 54 - :height 54} - ;;; photo - (view {:width 54 - :height 54 - :borderRadius 50 - :backgroundColor "#FFFFFF" - :elevation 6} - (image {:source (if (< 0 (count photo-path)) - {:uri photo-path} - res/user-no-photo) - :style {:borderWidth 2 - :borderColor "#FFFFFF" - :borderRadius 50 - :width 54 - :height 54 - :position "absolute"}})) - ;;; online - (when online - (view {:position "absolute" - :top 41 - :left 36 - :width 12 - :height 12 - :borderRadius 50 - :backgroundColor "#FFFFFF" - :elevation 6} - (image {:source res/online-icon - :style {:width 12 - :height 12}})))) - (view {:style {:flexDirection "column" - :marginLeft 7 - :marginRight 10 - :flex 1 - :position "relative"}} - ;;; name - (text {:style {:fontSize 15 - :fontFamily "Avenir-Roman"}} name) - ;;; last message - (text {:style {:color "#AAB2B2" - :fontFamily "Avenir-Roman" - :fontSize 14 - :marginTop 2 - :paddingRight 10}} - (str "Hi, I'm " name))) - (view {:style {:flexDirection "column"}} - ;;; delivery status - (view {:style {:flexDirection "row" - :position "absolute" - :top 0 - :right 0}} - (when delivery-status - (image {:source (if (= (keyword delivery-status) :seen) - res/seen-icon - res/delivered-icon) - :style {:marginTop 5}})) - ;;; datetime - (text {:style {:fontFamily "Avenir-Roman" - :fontSize 11 - :color "#AAB2B2" - :letterSpacing 1 - :lineHeight 15 - :marginLeft 5}} - datetime)) - ;;; new messages count - (when (< 0 new-messages-count) - (view {:style {:position "absolute" - :right 0 - :bottom 24 - :width 18 - :height 18 - :backgroundColor "#6BC6C8" - :borderColor "#FFFFFF" - :borderRadius 50 - :alignSelf "flex-end"}} - (text {:style {:width 18 - :height 17 - :fontFamily "Avenir-Roman" - :fontSize 10 - :color "#FFFFFF" - :lineHeight 19 - :textAlign "center" - :top 1}} - new-messages-count))))))))) - -(def contact (om/factory Contact {:keyfn :name})) - diff --git a/src/messenger/components/contact_list/contact_list.cljs b/src/messenger/components/contact_list/contact_list.cljs deleted file mode 100644 index fa07257529..0000000000 --- a/src/messenger/components/contact_list/contact_list.cljs +++ /dev/null @@ -1,47 +0,0 @@ -(ns messenger.components.contact-list.contact-list - (:require-macros - [natal-shell.components :refer [view text image touchable-highlight list-view - toolbar-android]] - [natal-shell.core :refer [with-error-view]]) - (:require [om.next :as om :refer-macros [defui]] - [messenger.utils.utils :refer [log toast http-post]] - [messenger.utils.resources :as res] - [messenger.comm.intercom :as intercom] - [messenger.components.contact-list.contact :refer [contact]] - [messenger.components.iname :as in] - [syng-im.utils.logging :as log])) - -(defn render-row [nav row section-id row-id] - (contact (om/computed (js->clj row :keywordize-keys true) - {:nav nav}))) - -(defn load-contacts [] - (intercom/load-syng-contacts)) - -(defui ContactList - static in/IName - (get-name [this] - :contacts/contacts) - static om/IQuery - (query [this] - '[:contacts-ds]) - Object - (componentDidMount [this] - (load-contacts)) - (render [this] - (let [{{contacts-ds :contacts-ds} :contacts/contacts} (om/props this) - {:keys [nav]} (om/get-computed this)] - (view {:style {:flex 1 - :backgroundColor "white"}} - (toolbar-android {:logo res/logo-icon - :title "Chats" - :titleColor "#4A5258" - :style {:backgroundColor "white" - :height 56 - :elevation 2}}) - (when contacts-ds - (list-view {:dataSource contacts-ds - :renderRow (partial render-row nav) - :style {:backgroundColor "white"}})))))) - -(def contact-list (om/factory ContactList)) diff --git a/src/messenger/components/iname.cljs b/src/messenger/components/iname.cljs deleted file mode 100644 index dfea6e7013..0000000000 --- a/src/messenger/components/iname.cljs +++ /dev/null @@ -1,4 +0,0 @@ -(ns messenger.components.iname) - -(defprotocol IName - (get-name [this])) diff --git a/src/messenger/components/invertible-scroll-view.cljs b/src/messenger/components/invertible-scroll-view.cljs deleted file mode 100644 index 4408077a77..0000000000 --- a/src/messenger/components/invertible-scroll-view.cljs +++ /dev/null @@ -1,7 +0,0 @@ -(ns messenger.components.invertible-scroll-view) - -(set! js/InvertibleScrollView (js/require "react-native-invertible-scroll-view")) - -(defn invertible-scroll-view [props] - (js/React.createElement js/InvertibleScrollView - (clj->js (merge {:inverted true} props)))) diff --git a/src/messenger/components/spinner.cljs b/src/messenger/components/spinner.cljs deleted file mode 100644 index 83c5f55f53..0000000000 --- a/src/messenger/components/spinner.cljs +++ /dev/null @@ -1,7 +0,0 @@ -(ns messenger.components.spinner) - -(set! js/Spinner (.-default (js/require "react-native-loading-spinner-overlay"))) - -(defn spinner [props] - (js/React.createElement js/Spinner - (clj->js props))) diff --git a/src/messenger/constants.cljs b/src/messenger/constants.cljs deleted file mode 100644 index b838bafd6a..0000000000 --- a/src/messenger/constants.cljs +++ /dev/null @@ -1,5 +0,0 @@ -(ns messenger.constants) - -(def ethereum-rpc-url "http://localhost:8545") - -(def text-content-type "text/plain") \ No newline at end of file diff --git a/src/messenger/init.cljs b/src/messenger/init.cljs deleted file mode 100644 index 70ca211e5c..0000000000 --- a/src/messenger/init.cljs +++ /dev/null @@ -1,6 +0,0 @@ -(ns messenger.init - (:require [messenger.persistence.simple-kv-store :as kv] - [messenger.state :as state])) - -(defn init-simple-store [] - (swap! state/app-state assoc-in state/simple-store-path (kv/->SimpleKvStore))) diff --git a/src/messenger/ios/core.cljs b/src/messenger/ios/core.cljs deleted file mode 100644 index db80e27637..0000000000 --- a/src/messenger/ios/core.cljs +++ /dev/null @@ -1,33 +0,0 @@ -(ns messenger.ios.core - (:require-macros [natal-shell.components :refer [view text image touchable-highlight]] - [natal-shell.alert :refer [alert]]) - (:require [om.next :as om :refer-macros [defui]] - [re-natal.support :as sup] - [messenger.omnext :as omnext])) - -(set! js/React (js/require "react-native")) - -(def app-registry (.-AppRegistry js/React)) -(def logo-img (js/require "./images/cljs.png")) - -(defui AppRoot - static om/IQuery - (query [this] - '[:app/msg]) - Object - (render [this] - (let [{:keys [app/msg]} (om/props this)] - (view {:style {:flexDirection "column" :margin 40 :alignItems "center"}} - (text {:style {:fontSize 30 :fontWeight "100" :marginBottom 20 :textAlign "center"}} msg) - (image {:source logo-img - :style {:width 80 :height 80 :marginBottom 30}}) - (touchable-highlight {:style {:backgroundColor "#999" :padding 10 :borderRadius 5} - :onPress #(alert "HELLO!")} - (text {:style {:color "white" :textAlign "center" :fontWeight "bold"}} "press me")))))) - -(defonce RootNode (sup/root-node! 1)) -(defonce app-root (om/factory RootNode)) - -(defn init [] - (om/add-root! omnext/reconciler AppRoot 1) - (.registerComponent app-registry "Messenger" (fn [] app-root))) \ No newline at end of file diff --git a/src/messenger/models/chat.cljs b/src/messenger/models/chat.cljs deleted file mode 100644 index bb7eddd8b0..0000000000 --- a/src/messenger/models/chat.cljs +++ /dev/null @@ -1,8 +0,0 @@ -(ns messenger.models.chat - (:require [messenger.state :as state])) - -(defn set-current-chat-id [chat-id] - (swap! state/app-state assoc-in state/current-chat-id-path chat-id)) - -(defn current-chat-id [] - (get-in @state/app-state state/current-chat-id-path)) diff --git a/src/messenger/models/contacts.cljs b/src/messenger/models/contacts.cljs deleted file mode 100644 index daa16cc9f8..0000000000 --- a/src/messenger/models/contacts.cljs +++ /dev/null @@ -1,78 +0,0 @@ -(ns messenger.models.contacts - (:require-macros [natal-shell.data-source :refer [data-source clone-with-rows]]) - (:require [cljs.core.async :as async :refer [chan put! !]] - [messenger.state :as state] - [messenger.utils.utils :refer [log toast http-post]] - [messenger.persistence.realm :as realm])) - -(def fake-contacts? false) - -(def react-native-contacts (js/require "react-native-contacts")) - -(defn- generate-contact [n] - {:name (str "Contact " n) - :photo-path "" - :phone-numbers [{:label "mobile" :number (apply str (repeat 7 n))}] - :delivery-status (if (< (rand) 0.5) :delivered :seen) - :datetime "15:30" - :new-messages-count (rand-int 3) - :online (< (rand) 0.5)}) - -(defn- generate-contacts [n] - (map generate-contact (range 1 (inc n)))) - -(defn load-phone-contacts [] - (let [ch (chan)] - (if fake-contacts? - (put! ch {:error nil, :contacts (generate-contacts 10)}) - (.getAll react-native-contacts - (fn [error raw-contacts] - (put! ch - {:error error - :contacts - (when (not error) - (map (fn [contact] - (merge contact - (generate-contact 1) - {:name (:givenName contact) - :photo-path (:thumbnailPath contact) - :phone-numbers (:phoneNumbers contact)})) - (js->clj raw-contacts :keywordize-keys true)))})))) - ch)) - -(defn- get-contacts [] - (realm/get-list "Contact")) - -(defn load-syng-contacts [] - (let [contacts (map (fn [contact] - (merge contact - {:delivery-status (if (< (rand) 0.5) :delivered :seen) - :datetime "15:30" - :new-messages-count (rand-int 3) - :online (< (rand) 0.5)})) - (get-contacts))] - (swap! state/app-state update :contacts-ds - #(clone-with-rows % contacts)))) - -(defn- create-contact [{:keys [phone-number whisper-identity name photo-path]}] - (realm/create "Contact" - {:phone-number phone-number - :whisper-identity whisper-identity - :name (or name "") - :photo-path (or photo-path "")})) - -(defn- contact-exist? [contacts contact] - (some #(= (:phone-number contact) (:phone-number %)) contacts)) - -(defn- add-contacts [contacts] - (realm/write (fn [] - (let [db-contacts (get-contacts)] - (dorun (map (fn [contact] - (if (not (contact-exist? db-contacts contact)) - (create-contact contact) - ;; TODO else override? - )) - contacts)))))) - -(defn save-syng-contacts [syng-contacts] - (add-contacts syng-contacts)) diff --git a/src/messenger/models/messages.cljs b/src/messenger/models/messages.cljs deleted file mode 100644 index 75bd0e9900..0000000000 --- a/src/messenger/models/messages.cljs +++ /dev/null @@ -1,42 +0,0 @@ -(ns messenger.models.messages - (:require [messenger.persistence.realm :as r] - [cljs.reader :refer [read-string]] - [syng-im.utils.random :refer [timestamp]])) - -(defn save-message [chat-id {:keys [from to msg-id content content-type outgoing] :or {outgoing false} :as msg}] - (when-not (r/exists? :msgs :msg-id msg-id) - (r/write - (fn [] - (r/create :msgs {:chat-id chat-id - :msg-id msg-id - :from from - :to to - :content content - :content-type content-type - :outgoing outgoing - :timestamp (timestamp)} true))))) - -(defn get-messages* [chat-id] - (-> (r/get-by-field :msgs :chat-id chat-id) - (r/sorted :timestamp :desc) - (r/page 0 10))) - -(defn get-messages [chat-id] - (-> (get-messages* chat-id) - (js->clj :keywordize-keys true))) - -(comment - - (save-message "0x040028c500ff086ecf1cfbb3c1a7240179cde5b86f9802e6799b9bbe9cdd7ad1b05ae8807fa1f9ed19cc8ce930fc2e878738c59f030a6a2f94b3522dc1378ff154" - {:msg-id "153" - :content "hello!" - :content-type "text/plain"}) - - (get-messages* "0x040028c500ff086ecf1cfbb3c1a7240179cde5b86f9802e6799b9bbe9cdd7ad1b05ae8807fa1f9ed19cc8ce930fc2e878738c59f030a6a2f94b3522dc1378ff154") - - (get-messages "0x043df89d36f6e3d8ade18e55ac3e2e39406ebde152f76f2f82d674681d59319ffd9880eebfb4f5f8d5c222ec485b44d6e30ba3a03c96b1c946144fdeba1caccd43") - - (doseq [msg (get-messages* "0x043df89d36f6e3d8ade18e55ac3e2e39406ebde152f76f2f82d674681d59319ffd9880eebfb4f5f8d5c222ec485b44d6e30ba3a03c96b1c946144fdeba1caccd43")] - (r/delete msg)) - - ) \ No newline at end of file diff --git a/src/messenger/models/navigation.cljs b/src/messenger/models/navigation.cljs deleted file mode 100644 index 7906c1c272..0000000000 --- a/src/messenger/models/navigation.cljs +++ /dev/null @@ -1,8 +0,0 @@ -(ns messenger.models.navigation - (:require [messenger.state :as state])) - -(defn set-current-screen-class [class] - (swap! state/app-state assoc-in [:current-screen-class] class)) - -(defn current-screen-class [] - (get-in @state/app-state [:current-screen-class])) diff --git a/src/messenger/models/protocol.cljs b/src/messenger/models/protocol.cljs deleted file mode 100644 index ea89f2aa5b..0000000000 --- a/src/messenger/models/protocol.cljs +++ /dev/null @@ -1,23 +0,0 @@ -(ns messenger.models.protocol - (:require [cljs.reader :refer [read-string]] - [messenger.state :as state] - [syng-im.protocol.state.storage :as s] - [syng-im.utils.encryption :refer [password-encrypt - password-decrypt]] - [messenger.utils.types :refer [to-edn-string]])) - -(defn set-initialized [initialized?] - (swap! state/app-state assoc-in state/protocol-initialized-path initialized?)) - -(defn update-identity [identity] - (let [password (get-in @state/app-state state/identity-password-path) - encrypted (->> (to-edn-string identity) - (password-encrypt password))] - (s/put (state/kv-store) :identity encrypted))) - -(defn current-identity [] - (let [encrypted (s/get (state/kv-store) :identity) - password (get-in @state/app-state state/identity-password-path)] - (when encrypted - (-> (password-decrypt password encrypted) - (read-string))))) diff --git a/src/messenger/models/user_data.cljs b/src/messenger/models/user_data.cljs deleted file mode 100644 index f61b712c12..0000000000 --- a/src/messenger/models/user_data.cljs +++ /dev/null @@ -1,28 +0,0 @@ -(ns messenger.models.user-data - (:require-macros - [natal-shell.async-storage :refer [get-item set-item]]) - (:require [cljs.core.async :as async :refer [chan put! !]] - [syng-im.protocol.web3 :as web3] - [messenger.state :as state] - [messenger.utils.utils :refer [log on-error toast]])) - -(defn set-phone-number [phone-number] - (swap! state/app-state assoc :user-phone-number phone-number)) - -(defn save-phone-number [phone-number] - (set-item "user-phone-number" phone-number) - (swap! state/app-state assoc :user-phone-number phone-number)) - -(defn load-phone-number [] - (get-item "user-phone-number" - (fn [error value] - (if error - (on-error error) - (swap! state/app-state assoc :user-phone-number (when value - (str value))))))) - -(defn set-identity [identity] - (swap! state/app-state assoc :user-identity identity)) - -(defn set-confirmation-code [code] - (swap! state/app-state assoc :confirmation-code code)) diff --git a/src/messenger/omnext.cljs b/src/messenger/omnext.cljs deleted file mode 100644 index e7a5cec606..0000000000 --- a/src/messenger/omnext.cljs +++ /dev/null @@ -1,74 +0,0 @@ -(ns messenger.omnext - (:require [om.next :as om] - [syng-im.utils.logging :as log] - [re-natal.support :as sup] - [messenger.models.messages :as msgs] - [messenger.models.chat :as chat] - [messenger.state :as state] - [messenger.components.iname :as in])) - -(defmulti read om/dispatch) - -(defmethod read :default [{:keys [state] :as env} key param] - (log/debug "reading" "key=" key "param=" param) - (let [st @state] - (if-let [[_ v] (find st key)] - {:value v} - {:value :not-found}))) - -(defmethod read :chat/chat [env key param] - (log/debug "reading" "key=" key "param=" param) - (let [chat-id (chat/current-chat-id) - val {:value {:chat/messages (msgs/get-messages chat-id) - :chat/chat-id chat-id}} - _ (log/debug "returning" val)] - val)) - -(defmethod read :chat/messages [env key param] - (log/debug "reading" "key=" key "param=" param) - (let [chat-id (chat/current-chat-id) - val {:value {:chat/messages (msgs/get-messages chat-id) - :chat/chat-id chat-id}} - _ (log/debug "returning" val)] - val)) - -(defmethod read :contacts/contacts [env key param] - (log/debug "reading" "key=" key "param=" param) - (let [val {:value {:contacts-ds (get-in @state/app-state [:contacts-ds])}} - _ (log/debug "returning" val)] - val)) - -(defmethod read :login/login [env key param] - (log/debug "reading" "key=" key "param=" param) - (let [val {:value (select-keys @state/app-state [:user-phone-number :user-identity :loading])} - _ (log/debug "returning" val)] - val)) - -(defmethod read :signup/confirm [env key param] - (log/debug "reading" "key=" key "param=" param) - (let [val {:value (select-keys @state/app-state [:confirmation-code :loading])} - _ (log/debug "returning" val)] - val)) - -(defmulti mutate om/dispatch) - -(defmethod mutate 'chat/add-msg-to-chat [{:keys [state] :as env} key {:keys [chat-id msg] :as param}] - (log/debug "writing" "key=" key "param=" param) - {:action #(do - (log/debug "Writing msg to db") - (msgs/save-message chat-id msg) - (swap! state/app-state assoc-in [:chat :messages] msg))}) - -(defonce reconciler - (om/reconciler - {:state state/app-state - :parser (om/parser {:read read - :mutate mutate}) - :root-render sup/root-render - :root-unmount sup/root-unmount})) - - -(defn set-root-query [component] - (let [app-root (om/class->any reconciler (om/app-root reconciler))] - (om/set-query! app-root {:query [{(in/get-name component) (om/get-query component)}]}) - (om.next.protocols/reindex! reconciler))) \ No newline at end of file diff --git a/src/messenger/persistence/realm.cljs b/src/messenger/persistence/realm.cljs deleted file mode 100644 index b25ee6788e..0000000000 --- a/src/messenger/persistence/realm.cljs +++ /dev/null @@ -1,94 +0,0 @@ -(ns messenger.persistence.realm - (:require [cljs.reader :refer [read-string]] - [syng-im.utils.logging :as log] - [messenger.utils.types :refer [to-string]]) - (:refer-clojure :exclude [exists?])) - -(set! js/Realm (js/require "realm")) - -(def opts {:schema [{:name "Contact" - :properties {:phone-number "string" - :whisper-identity "string" - :name "string" - :photo-path "string"}} - {:name :kv-store - :primaryKey :key - :properties {:key "string" - :value "string"}} - {:name :msgs - :primaryKey :msg-id - :properties {:msg-id "string" - :from "string" - :to "string" - :content "string" ;; TODO make it ArrayBuffer - :content-type "string" - :timestamp "int" - :chat-id "string" - :outgoing "bool"}}]}) - -(def realm (js/Realm. (clj->js opts))) - -(def schema-by-name (->> (:schema opts) - (mapv (fn [{:keys [name] :as schema}] - [name schema])) - (into {}))) - -(defn field-type [schema-name field] - (get-in schema-by-name [schema-name :properties field])) - -(defn write [f] - (.write realm f)) - -(defn create - ([schema-name obj] - (create schema-name obj false)) - ([schema-name obj update?] - (.create realm (to-string schema-name) (clj->js obj) update?))) - -(defmulti to-query (fn [schema-name operator field value] - operator)) - -(defmethod to-query :eq [schema-name operator field value] - (let [value (to-string value) - query (str (name field) "=" (if (= "string" (field-type schema-name field)) - (str "\"" value "\"") - value)) - ;_ (log/debug query) - ] - query)) - -(defn get-by-field [schema-name field value] - (-> (.objects realm (name schema-name)) - (.filtered (to-query schema-name :eq field value)))) - -(defn sorted [results field-name order] - (.sorted results (to-string field-name) (if (= order :asc) - false - true))) - -(defn page [results from to] - (js/Array.prototype.slice.call results from to)) - -(defn single [result] - (-> (aget result 0))) - -(defn single-cljs [result] - (some-> (aget result 0) - (js->clj :keywordize-keys true))) - -(defn decode-value [{:keys [key value]}] - (read-string value)) - -(defn delete [obj] - (write (fn [] - (.delete realm obj)))) - -(defn exists? [schema-name field value] - (> (.-length (get-by-field schema-name field value)) - 0)) - -(defn get-count [objs] - (.-length objs)) - -(defn get-list [schema-name] - (vals (js->clj (.objects realm schema-name) :keywordize-keys true))) diff --git a/src/messenger/persistence/simple_kv_store.cljs b/src/messenger/persistence/simple_kv_store.cljs deleted file mode 100644 index 75f243e846..0000000000 --- a/src/messenger/persistence/simple_kv_store.cljs +++ /dev/null @@ -1,26 +0,0 @@ -(ns messenger.persistence.simple-kv-store - (:require [syng-im.protocol.state.storage :as st] - [messenger.persistence.realm :as r] - [messenger.utils.types :refer [to-edn-string]])) - -(defrecord SimpleKvStore [] - st/Storage - (put [_ key value] - (r/write - (fn [] - (r/create :kv-store {:key key - :value (to-edn-string value)} true)))) - (get [_ key] - (some-> (r/get-by-field :kv-store :key key) - (r/single-cljs) - (r/decode-value))) - (contains-key? [_ key] - (r/exists? :kv-store :key key)) - (delete [_ key] - (-> (r/get-by-field :kv-store :key key) - (r/single) - (r/delete)))) - -(comment - - ) \ No newline at end of file diff --git a/src/messenger/protocol/protocol_handler.cljs b/src/messenger/protocol/protocol_handler.cljs deleted file mode 100644 index caeecd0d42..0000000000 --- a/src/messenger/protocol/protocol_handler.cljs +++ /dev/null @@ -1,46 +0,0 @@ -(ns messenger.protocol.protocol-handler - (:require [syng-im.utils.logging :as log] - [messenger.constants :refer [ethereum-rpc-url]] - [messenger.comm.intercom :refer [protocol-initialized - save-new-msg]] - [messenger.models.protocol :refer [current-identity]] - [messenger.state :refer [kv-store]])) - - -(defn make-handler [] - {:ethereum-rpc-url ethereum-rpc-url - :identity (current-identity) - :storage (kv-store) - :handler (fn [{:keys [event-type] :as event}] - (log/info "Event:" (clj->js event)) - (case event-type - :initialized (let [{:keys [identity]} event] - (protocol-initialized identity)) - :new-msg (let [{:keys [from to payload]} event] - (save-new-msg (assoc payload :from from :to to))) - ;:msg-acked (let [{:keys [msg-id]} event] - ; (add-to-chat "chat" ":" (str "Message " msg-id " was acked"))) - ;:delivery-failed (let [{:keys [msg-id]} event] - ; (add-to-chat "chat" ":" (str "Delivery of message " msg-id " failed"))) - ;:new-group-chat (let [{:keys [from group-id identities]} event] - ; (set-group-id! group-id) - ; (set-group-identities identities) - ; (add-to-chat "group-chat" ":" (str "Received group chat invitation from " from " for group-id: " group-id))) - ;:group-chat-invite-acked (let [{:keys [from group-id]} event] - ; (add-to-chat "group-chat" ":" (str "Received ACK for group chat invitation from " from " for group-id: " group-id))) - ;:new-group-msg (let [{from :from - ; {content :content} :payload} event] - ; (add-to-chat "group-chat" from content)) - ;:group-new-participant (let [{:keys [group-id identity from]} event] - ; (add-to-chat "group-chat" ":" (str (shorten from) " added " (shorten identity) " to group chat")) - ; (add-identity-to-group-list identity)) - ;:group-removed-participant (let [{:keys [group-id identity from]} event] - ; (add-to-chat "group-chat" ":" (str (shorten from) " removed " (shorten identity) " from group chat")) - ; (remove-identity-from-group-list identity)) - ;:removed-from-group (let [{:keys [group-id from]} event] - ; (add-to-chat "group-chat" ":" (str (shorten from) " removed you from group chat"))) - ;:participant-left-group (let [{:keys [group-id from]} event] - ; (add-to-chat "group-chat" ":" (str (shorten from) " left group chat"))) - ;(add-to-chat "chat" ":" (str "Don't know how to handle " event-type)) - (log/info "Don't know how to handle" event-type) - ))}) diff --git a/src/messenger/services/contacts.cljs b/src/messenger/services/contacts.cljs deleted file mode 100644 index 74417b59e0..0000000000 --- a/src/messenger/services/contacts.cljs +++ /dev/null @@ -1,84 +0,0 @@ -(ns messenger.services.contacts - (:require-macros [cljs.core.async.macros :refer [go]]) - (:require [clojure.string :as cstr] - [cljs.core.async :as async :refer [chan put! clj (:contacts data)))) - -(defn- get-contacts-by-hash [contacts] - (let [numbers-info (reduce (fn [numbers contact] - (into numbers - (map (fn [c] - {:number (format-phone-number (:number c)) - :contact contact}) - (:phone-numbers contact)))) - '() - contacts)] - (reduce (fn [m number-info] - (let [number (:number number-info) - hash (encrypt number)] - (assoc m hash number-info))) - {} - numbers-info))) - -(defn- request-syng-contacts [contacts] - (let [contacts-by-hash (get-contacts-by-hash contacts) - data (keys contacts-by-hash) - ch (chan)] - (http-post "get-contacts" {:phone-number-hashes data} - (fn [data] - (put! ch - (to-syng-contacts contacts-by-hash data)))) - ch)) - -(defn sync-contacts [handler] - (go - (let [result (js route)))) - -(defn nav-replace [nav route] - (binding [state/*nav-render* false] - (.replace nav (clj->js route)))) - -(defmulti navigate-to (fn [state id args] - id)) - -(defmethod navigate-to :scene/chat - [state id {:keys [navigator chat-id] :as args}] - (log/debug "handling " id "args = " (dissoc args :navigator)) - (n/set-current-screen-class chat/Chat) - (set-current-chat-id chat-id) - (nav-push navigator {:component chat/chat})) - -(defmethod navigate-to :scene/signup-confirm - [state id {:keys [navigator] :as args}] - (log/debug "handling " id "args = " (dissoc args :navigator)) - (n/set-current-screen-class sc/SignUpConfirm) - (nav-replace navigator {:component sc/sign-up-confirm - :name "sign-up-confirm"})) - -(defmethod navigate-to :scene/contacts - [state id {:keys [navigator] :as args}] - (log/debug "handling " id "args = " (dissoc args :navigator)) - (n/set-current-screen-class cl/ContactList) - (nav-replace navigator {:component cl/contact-list - :name "contact-list"})) - -(defn navigate-to-handler [state [id args]] - (log/debug "navigate-to-handler: " (dissoc args :navigator)) - (navigate-to state id args)) - - -(comment - - ) \ No newline at end of file diff --git a/src/messenger/services/protocol.cljs b/src/messenger/services/protocol.cljs deleted file mode 100644 index 184290dd97..0000000000 --- a/src/messenger/services/protocol.cljs +++ /dev/null @@ -1,58 +0,0 @@ -(ns messenger.services.protocol - (:require [messenger.models.protocol :refer [set-initialized - update-identity]] - [messenger.models.messages :refer [save-message]] - [messenger.models.user-data :refer [set-identity]] - [syng-im.utils.logging :as log] - [syng-im.protocol.api :as api] - [messenger.omnext :as omnext] - [om.next :as om] - [messenger.constants :refer [text-content-type]])) - -(defmulti protocol (fn [state id args] - id)) - -(defmethod protocol :protocol/initialized - [state id {:keys [identity] :as args}] - (log/debug "handling " id "args = " args) - (update-identity identity) - (set-identity identity) - (set-initialized true)) - -(defmethod protocol :protocol/save-new-msg - [state id {{from :from :as msg} :msg :as args}] - (log/debug "handling " id "args = " args) - (let [chat-id from] - (om/transact! omnext/reconciler `[(chat/add-msg-to-chat {:msg ~msg - :chat-id ~chat-id}) [:chat/messages :chat/chat-id :chat/chat]]))) - -(defmethod protocol :protocol/send-msg - [state id {:keys [chat-id text] :as args}] - (log/debug "handling " id "args = " args) - (let [{msg-id :msg-id - {from :from - to :to} :msg} (api/send-user-msg {:to chat-id - :content text}) - msg {:msg-id msg-id - :from from - :to to - :content text - :content-type text-content-type - :outgoing true}] - (om/transact! omnext/reconciler ;;(om/class->any omnext/reconciler messenger.components.chat.chat/Chat) - `[(chat/add-msg-to-chat {:msg ~msg - :chat-id ~chat-id}) [:chat/messages :chat/chat-id :chat/chat]]))) - -(defn protocol-handler [state [id args]] - (log/debug "protocol-handler: " args) - (protocol state id args)) - - -(comment - - (om/transact! omnext/reconciler `[(chat/add-msg-to-chat {:msg {:msg-id "1458670960090-ed5f995a-b686-5cbe-bf96-8a60ada8f6c3"} - :chat-id "1"}) [:chat/chat]]) - - (om/get-indexer omnext/reconciler) -(om.next.protocols/reindex! omnext/reconciler) - ) \ No newline at end of file diff --git a/src/messenger/services/server.cljs b/src/messenger/services/server.cljs deleted file mode 100644 index 41bb77e748..0000000000 --- a/src/messenger/services/server.cljs +++ /dev/null @@ -1,31 +0,0 @@ -(ns messenger.services.server - (:require-macros [cljs.core.async.macros :refer [go]]) - (:require [cljs.core.async :as async :refer [chan put! (.digest sha-256) - byteArrayToHex)) diff --git a/src/messenger/utils/event.cljs b/src/messenger/utils/event.cljs deleted file mode 100644 index e099962087..0000000000 --- a/src/messenger/utils/event.cljs +++ /dev/null @@ -1,9 +0,0 @@ -(ns messenger.utils.event - (:require [cljs.core.async :refer [ (om/get-state component) - (js->clj :keywordize-keys true) - key)) diff --git a/src/messenger/utils/types.cljs b/src/messenger/utils/types.cljs deleted file mode 100644 index 883daf94b0..0000000000 --- a/src/messenger/utils/types.cljs +++ /dev/null @@ -1,9 +0,0 @@ -(ns messenger.utils.types) - -(defn to-string [s] - (if (keyword? s) - (name s) - s)) - -(defn to-edn-string [value] - (with-out-str (pr value))) \ No newline at end of file diff --git a/src/messenger/utils/utils.cljs b/src/messenger/utils/utils.cljs deleted file mode 100644 index 4da237a1c7..0000000000 --- a/src/messenger/utils/utils.cljs +++ /dev/null @@ -1,38 +0,0 @@ -(ns messenger.utils.utils - (:require-macros - [natal-shell.async-storage :refer [get-item set-item]] - [natal-shell.alert :refer [alert]] - [natal-shell.toast-android :as toast])) - -(def server-address "http://rpc0.syng.im:20000/") -;; (def server-address "http://10.0.3.2:3000/") - -(defn log [obj] - (.log js/console obj)) - -(defn toast [s] - (toast/show s (toast/long))) - -(defn on-error [error] - (toast (str "error: " error))) - -(defn http-post - ([action data on-success] - (http-post action data on-success nil)) - ([action data on-success on-error] - (-> (.fetch js/window - (str server-address action) - (clj->js {:method "POST" - :headers {:accept "application/json" - :content-type "application/json"} - :body (.stringify js/JSON (clj->js data))})) - (.then (fn [response] - (log response) - (.text response))) - (.then (fn [text] - (let [json (.parse js/JSON text) - obj (js->clj json :keywordize-keys true)] - (on-success obj)))) - (.catch (or on-error - (fn [error] - (toast (str error)))))))) diff --git a/src/re_natal/support.cljs b/src/re_natal/support.cljs deleted file mode 100644 index b38fcf0e2a..0000000000 --- a/src/re_natal/support.cljs +++ /dev/null @@ -1,35 +0,0 @@ -(ns re-natal.support - (:require [om.next :refer-macros [ui]])) - -(defonce root-nodes (atom {})) - -(defn root-node! - "A substitute for a real root node (1) for mounting om-next component. - You have to call function :on-render and :on-unmount in reconciler :root-render :root-unmount function." - [id] - (let [content (atom nil) - instance (atom nil) - class (ui Object - (componentWillMount [this] (reset! instance this)) - (render [_] @content))] - (swap! root-nodes assoc id {:on-render (fn [el] - (reset! content el) - (when @instance - (.forceUpdate @instance))) - :on-unmount (fn []) - :class class}) - class)) -(defn root-render - "Use this as reconciler :root-render function." - [el id] - (let [node (get @root-nodes id) - on-render (:on-render node)] - (when on-render (on-render el)))) - -(defn root-unmount - "Use this as reconciler :root-unmount function." - [id] - (let [node (get @root-nodes id) - unmount-fn (:on-unmount node)] - (when unmount-fn (unmount-fn)))) - diff --git a/syng-im/src/syng_im/android/core.cljs b/src/syng_im/android/core.cljs similarity index 100% rename from syng-im/src/syng_im/android/core.cljs rename to src/syng_im/android/core.cljs diff --git a/syng-im/src/syng_im/components/action_button.cljs b/src/syng_im/components/action_button.cljs similarity index 100% rename from syng-im/src/syng_im/components/action_button.cljs rename to src/syng_im/components/action_button.cljs diff --git a/syng-im/src/syng_im/components/chat.cljs b/src/syng_im/components/chat.cljs similarity index 100% rename from syng-im/src/syng_im/components/chat.cljs rename to src/syng_im/components/chat.cljs diff --git a/syng-im/src/syng_im/components/chat/chat_message.cljs b/src/syng_im/components/chat/chat_message.cljs similarity index 100% rename from syng-im/src/syng_im/components/chat/chat_message.cljs rename to src/syng_im/components/chat/chat_message.cljs diff --git a/syng-im/src/syng_im/components/chat/chat_message_new.cljs b/src/syng_im/components/chat/chat_message_new.cljs similarity index 100% rename from syng-im/src/syng_im/components/chat/chat_message_new.cljs rename to src/syng_im/components/chat/chat_message_new.cljs diff --git a/syng-im/src/syng_im/components/chat/input/money.cljs b/src/syng_im/components/chat/input/money.cljs similarity index 100% rename from syng-im/src/syng_im/components/chat/input/money.cljs rename to src/syng_im/components/chat/input/money.cljs diff --git a/syng-im/src/syng_im/components/chat/input/password.cljs b/src/syng_im/components/chat/input/password.cljs similarity index 100% rename from syng-im/src/syng_im/components/chat/input/password.cljs rename to src/syng_im/components/chat/input/password.cljs diff --git a/syng-im/src/syng_im/components/chat/input/phone.cljs b/src/syng_im/components/chat/input/phone.cljs similarity index 100% rename from syng-im/src/syng_im/components/chat/input/phone.cljs rename to src/syng_im/components/chat/input/phone.cljs diff --git a/syng-im/src/syng_im/components/chat/input/simple_command.cljs b/src/syng_im/components/chat/input/simple_command.cljs similarity index 100% rename from syng-im/src/syng_im/components/chat/input/simple_command.cljs rename to src/syng_im/components/chat/input/simple_command.cljs diff --git a/syng-im/src/syng_im/components/chat/plain_message_input.cljs b/src/syng_im/components/chat/plain_message_input.cljs similarity index 100% rename from syng-im/src/syng_im/components/chat/plain_message_input.cljs rename to src/syng_im/components/chat/plain_message_input.cljs diff --git a/syng-im/src/syng_im/components/chat/suggestions.cljs b/src/syng_im/components/chat/suggestions.cljs similarity index 100% rename from syng-im/src/syng_im/components/chat/suggestions.cljs rename to src/syng_im/components/chat/suggestions.cljs diff --git a/syng-im/src/syng_im/components/chats/chat_list_item.cljs b/src/syng_im/components/chats/chat_list_item.cljs similarity index 100% rename from syng-im/src/syng_im/components/chats/chat_list_item.cljs rename to src/syng_im/components/chats/chat_list_item.cljs diff --git a/syng-im/src/syng_im/components/chats/chats_list.cljs b/src/syng_im/components/chats/chats_list.cljs similarity index 100% rename from syng-im/src/syng_im/components/chats/chats_list.cljs rename to src/syng_im/components/chats/chats_list.cljs diff --git a/syng-im/src/syng_im/components/chats/new_group.cljs b/src/syng_im/components/chats/new_group.cljs similarity index 100% rename from syng-im/src/syng_im/components/chats/new_group.cljs rename to src/syng_im/components/chats/new_group.cljs diff --git a/syng-im/src/syng_im/components/chats/new_group_contact.cljs b/src/syng_im/components/chats/new_group_contact.cljs similarity index 100% rename from syng-im/src/syng_im/components/chats/new_group_contact.cljs rename to src/syng_im/components/chats/new_group_contact.cljs diff --git a/syng-im/src/syng_im/components/contact_list/contact.cljs b/src/syng_im/components/contact_list/contact.cljs similarity index 100% rename from syng-im/src/syng_im/components/contact_list/contact.cljs rename to src/syng_im/components/contact_list/contact.cljs diff --git a/syng-im/src/syng_im/components/contact_list/contact_inner.cljs b/src/syng_im/components/contact_list/contact_inner.cljs similarity index 100% rename from syng-im/src/syng_im/components/contact_list/contact_inner.cljs rename to src/syng_im/components/contact_list/contact_inner.cljs diff --git a/syng-im/src/syng_im/components/contact_list/contact_list.cljs b/src/syng_im/components/contact_list/contact_list.cljs similarity index 100% rename from syng-im/src/syng_im/components/contact_list/contact_list.cljs rename to src/syng_im/components/contact_list/contact_list.cljs diff --git a/syng-im/src/syng_im/components/icons/ionicons.cljs b/src/syng_im/components/icons/ionicons.cljs similarity index 100% rename from syng-im/src/syng_im/components/icons/ionicons.cljs rename to src/syng_im/components/icons/ionicons.cljs diff --git a/syng-im/src/syng_im/components/invertible_scroll_view.cljs b/src/syng_im/components/invertible_scroll_view.cljs similarity index 100% rename from syng-im/src/syng_im/components/invertible_scroll_view.cljs rename to src/syng_im/components/invertible_scroll_view.cljs diff --git a/syng-im/src/syng_im/components/item_checkbox.cljs b/src/syng_im/components/item_checkbox.cljs similarity index 100% rename from syng-im/src/syng_im/components/item_checkbox.cljs rename to src/syng_im/components/item_checkbox.cljs diff --git a/syng-im/src/syng_im/components/react.cljs b/src/syng_im/components/react.cljs similarity index 100% rename from syng-im/src/syng_im/components/react.cljs rename to src/syng_im/components/react.cljs diff --git a/syng-im/src/syng_im/components/realm.cljs b/src/syng_im/components/realm.cljs similarity index 100% rename from syng-im/src/syng_im/components/realm.cljs rename to src/syng_im/components/realm.cljs diff --git a/syng-im/src/syng_im/components/sign_up.cljs b/src/syng_im/components/sign_up.cljs similarity index 100% rename from syng-im/src/syng_im/components/sign_up.cljs rename to src/syng_im/components/sign_up.cljs diff --git a/syng-im/src/syng_im/components/sign_up_confirm.cljs b/src/syng_im/components/sign_up_confirm.cljs similarity index 100% rename from syng-im/src/syng_im/components/sign_up_confirm.cljs rename to src/syng_im/components/sign_up_confirm.cljs diff --git a/syng-im/src/syng_im/components/spinner.cljs b/src/syng_im/components/spinner.cljs similarity index 100% rename from syng-im/src/syng_im/components/spinner.cljs rename to src/syng_im/components/spinner.cljs diff --git a/syng-im/src/syng_im/constants.cljs b/src/syng_im/constants.cljs similarity index 100% rename from syng-im/src/syng_im/constants.cljs rename to src/syng_im/constants.cljs diff --git a/syng-im/src/syng_im/db.cljs b/src/syng_im/db.cljs similarity index 100% rename from syng-im/src/syng_im/db.cljs rename to src/syng_im/db.cljs diff --git a/syng-im/src/syng_im/handlers.cljs b/src/syng_im/handlers.cljs similarity index 100% rename from syng-im/src/syng_im/handlers.cljs rename to src/syng_im/handlers.cljs diff --git a/syng-im/src/syng_im/handlers/commands.cljs b/src/syng_im/handlers/commands.cljs similarity index 100% rename from syng-im/src/syng_im/handlers/commands.cljs rename to src/syng_im/handlers/commands.cljs diff --git a/syng-im/src/syng_im/handlers/contacts.cljs b/src/syng_im/handlers/contacts.cljs similarity index 100% rename from syng-im/src/syng_im/handlers/contacts.cljs rename to src/syng_im/handlers/contacts.cljs diff --git a/syng-im/src/syng_im/handlers/server.cljs b/src/syng_im/handlers/server.cljs similarity index 100% rename from syng-im/src/syng_im/handlers/server.cljs rename to src/syng_im/handlers/server.cljs diff --git a/syng-im/src/syng_im/handlers/sign_up.cljs b/src/syng_im/handlers/sign_up.cljs similarity index 100% rename from syng-im/src/syng_im/handlers/sign_up.cljs rename to src/syng_im/handlers/sign_up.cljs diff --git a/syng-im/src/syng_im/handlers/suggestions.cljs b/src/syng_im/handlers/suggestions.cljs similarity index 100% rename from syng-im/src/syng_im/handlers/suggestions.cljs rename to src/syng_im/handlers/suggestions.cljs diff --git a/syng-im/src/syng_im/ios/core.cljs b/src/syng_im/ios/core.cljs similarity index 100% rename from syng-im/src/syng_im/ios/core.cljs rename to src/syng_im/ios/core.cljs diff --git a/syng-im/src/syng_im/models/chat.cljs b/src/syng_im/models/chat.cljs similarity index 100% rename from syng-im/src/syng_im/models/chat.cljs rename to src/syng_im/models/chat.cljs diff --git a/syng-im/src/syng_im/models/chats.cljs b/src/syng_im/models/chats.cljs similarity index 100% rename from syng-im/src/syng_im/models/chats.cljs rename to src/syng_im/models/chats.cljs diff --git a/syng-im/src/syng_im/models/commands.cljs b/src/syng_im/models/commands.cljs similarity index 100% rename from syng-im/src/syng_im/models/commands.cljs rename to src/syng_im/models/commands.cljs diff --git a/syng-im/src/syng_im/models/contacts.cljs b/src/syng_im/models/contacts.cljs similarity index 100% rename from syng-im/src/syng_im/models/contacts.cljs rename to src/syng_im/models/contacts.cljs diff --git a/syng-im/src/syng_im/models/messages.cljs b/src/syng_im/models/messages.cljs similarity index 100% rename from syng-im/src/syng_im/models/messages.cljs rename to src/syng_im/models/messages.cljs diff --git a/syng-im/src/syng_im/models/protocol.cljs b/src/syng_im/models/protocol.cljs similarity index 100% rename from syng-im/src/syng_im/models/protocol.cljs rename to src/syng_im/models/protocol.cljs diff --git a/syng-im/src/syng_im/models/user_data.cljs b/src/syng_im/models/user_data.cljs similarity index 100% rename from syng-im/src/syng_im/models/user_data.cljs rename to src/syng_im/models/user_data.cljs diff --git a/syng-im/src/syng_im/navigation.cljs b/src/syng_im/navigation.cljs similarity index 100% rename from syng-im/src/syng_im/navigation.cljs rename to src/syng_im/navigation.cljs diff --git a/syng-im/src/syng_im/persistence/realm.cljs b/src/syng_im/persistence/realm.cljs similarity index 100% rename from syng-im/src/syng_im/persistence/realm.cljs rename to src/syng_im/persistence/realm.cljs diff --git a/syng-im/src/syng_im/persistence/simple_kv_store.cljs b/src/syng_im/persistence/simple_kv_store.cljs similarity index 100% rename from syng-im/src/syng_im/persistence/simple_kv_store.cljs rename to src/syng_im/persistence/simple_kv_store.cljs diff --git a/syng-im/src/syng_im/protocol/protocol_handler.cljs b/src/syng_im/protocol/protocol_handler.cljs similarity index 100% rename from syng-im/src/syng_im/protocol/protocol_handler.cljs rename to src/syng_im/protocol/protocol_handler.cljs diff --git a/syng-im/src/syng_im/resources.cljs b/src/syng_im/resources.cljs similarity index 100% rename from syng-im/src/syng_im/resources.cljs rename to src/syng_im/resources.cljs diff --git a/syng-im/src/syng_im/subs.cljs b/src/syng_im/subs.cljs similarity index 100% rename from syng-im/src/syng_im/subs.cljs rename to src/syng_im/subs.cljs diff --git a/syng-im/src/syng_im/utils/crypt.cljs b/src/syng_im/utils/crypt.cljs similarity index 100% rename from syng-im/src/syng_im/utils/crypt.cljs rename to src/syng_im/utils/crypt.cljs diff --git a/syng-im/src/syng_im/utils/event.cljs b/src/syng_im/utils/event.cljs similarity index 100% rename from syng-im/src/syng_im/utils/event.cljs rename to src/syng_im/utils/event.cljs diff --git a/syng-im/src/syng_im/utils/listview.cljs b/src/syng_im/utils/listview.cljs similarity index 100% rename from syng-im/src/syng_im/utils/listview.cljs rename to src/syng_im/utils/listview.cljs diff --git a/syng-im/src/syng_im/utils/phone_number.cljs b/src/syng_im/utils/phone_number.cljs similarity index 100% rename from syng-im/src/syng_im/utils/phone_number.cljs rename to src/syng_im/utils/phone_number.cljs diff --git a/syng-im/src/syng_im/utils/types.cljs b/src/syng_im/utils/types.cljs similarity index 100% rename from syng-im/src/syng_im/utils/types.cljs rename to src/syng_im/utils/types.cljs diff --git a/syng-im/src/syng_im/utils/utils.cljs b/src/syng_im/utils/utils.cljs similarity index 100% rename from syng-im/src/syng_im/utils/utils.cljs rename to src/syng_im/utils/utils.cljs diff --git a/syng-im/.flowconfig b/syng-im/.flowconfig deleted file mode 100644 index c3edaf9464..0000000000 --- a/syng-im/.flowconfig +++ /dev/null @@ -1,65 +0,0 @@ -[ignore] - -# We fork some components by platform. -.*/*.web.js -.*/*.android.js - -# Some modules have their own node_modules with overlap -.*/node_modules/node-haste/.* - -# Ugh -.*/node_modules/babel.* -.*/node_modules/babylon.* -.*/node_modules/invariant.* - -# Ignore react and fbjs where there are overlaps, but don't ignore -# anything that react-native relies on -.*/node_modules/fbjs/lib/Map.js -.*/node_modules/fbjs/lib/Promise.js -.*/node_modules/fbjs/lib/fetch.js -.*/node_modules/fbjs/lib/ExecutionEnvironment.js -.*/node_modules/fbjs/lib/isEmpty.js -.*/node_modules/fbjs/lib/crc32.js -.*/node_modules/fbjs/lib/ErrorUtils.js - -# Flow has a built-in definition for the 'react' module which we prefer to use -# over the currently-untyped source -.*/node_modules/react/react.js -.*/node_modules/react/lib/React.js -.*/node_modules/react/lib/ReactDOM.js - -# Ignore commoner tests -.*/node_modules/commoner/test/.* - -# See https://github.com/facebook/flow/issues/442 -.*/react-tools/node_modules/commoner/lib/reader.js - -# Ignore jest -.*/node_modules/jest-cli/.* - -# Ignore Website -.*/website/.* - -[include] - -[libs] -node_modules/react-native/Libraries/react-native/react-native-interface.js - -[options] -module.system=haste - -munge_underscores=true - -module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub' -module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\)$' -> 'RelativeImageStub' - -suppress_type=$FlowIssue -suppress_type=$FlowFixMe -suppress_type=$FixMe - -suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-1]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) -suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-1]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ -suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy - -[version] -0.21.0 diff --git a/syng-im/.gitignore b/syng-im/.gitignore deleted file mode 100644 index 81c8fbfbec..0000000000 --- a/syng-im/.gitignore +++ /dev/null @@ -1,44 +0,0 @@ -# OSX -# -.DS_Store - -# Xcode -# -build/ -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata -*.xccheckout -*.moved-aside -DerivedData -*.hmap -*.ipa -*.xcuserstate -project.xcworkspace - -# Android/IJ -# -.idea -.gradle -local.properties - -# node.js -# -node_modules/ -npm-debug.log - -# Generated by re-natal -# -index.android.js -index.ios.js -target/ - -# Figwheel -# -figwheel_server.log \ No newline at end of file diff --git a/syng-im/.re-natal b/syng-im/.re-natal deleted file mode 100644 index 8fd652b4ea..0000000000 --- a/syng-im/.re-natal +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "SyngIm", - "interface": "reagent", - "androidHost": "10.0.3.2", - "modules": [ - "react-native-contacts", - "react-native-invertible-scroll-view", - "awesome-phonenumber", - "realm", - "react-native-loading-spinner-overlay", - "react-native-i18n", - "realm/react-native", - "react-native-action-button", - "react-native-vector-icons/Ionicons", - "react-native-circle-checkbox", - "react-native-randombytes" - ], - "imageDirs": [ - "images" - ] -} \ No newline at end of file diff --git a/syng-im/.watchmanconfig b/syng-im/.watchmanconfig deleted file mode 100644 index 9e26dfeeb6..0000000000 --- a/syng-im/.watchmanconfig +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/syng-im/CHANGELOG.md b/syng-im/CHANGELOG.md deleted file mode 100644 index e03cc81c3e..0000000000 --- a/syng-im/CHANGELOG.md +++ /dev/null @@ -1,24 +0,0 @@ -# Change Log -All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/). - -## [Unreleased][unreleased] -### Changed -- Add a new arity to `make-widget-async` to provide a different widget shape. - -## [0.1.1] - 2016-03-23 -### Changed -- Documentation on how to make the widgets. - -### Removed -- `make-widget-sync` - we're all async, all the time. - -### Fixed -- Fixed widget maker to keep working when daylight savings switches over. - -## 0.1.0 - 2016-03-23 -### Added -- Files from the new template. -- Widget maker public API - `make-widget-sync`. - -[unreleased]: https://github.com/your-name/syng-im/compare/0.1.1...HEAD -[0.1.1]: https://github.com/your-name/syng-im/compare/0.1.0...0.1.1 diff --git a/syng-im/LICENSE b/syng-im/LICENSE deleted file mode 100644 index 7689f30efd..0000000000 --- a/syng-im/LICENSE +++ /dev/null @@ -1,214 +0,0 @@ -THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC -LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM -CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - -1. DEFINITIONS - -"Contribution" means: - -a) in the case of the initial Contributor, the initial code and -documentation distributed under this Agreement, and - -b) in the case of each subsequent Contributor: - -i) changes to the Program, and - -ii) additions to the Program; - -where such changes and/or additions to the Program originate from and are -distributed by that particular Contributor. A Contribution 'originates' from -a Contributor if it was added to the Program by such Contributor itself or -anyone acting on such Contributor's behalf. Contributions do not include -additions to the Program which: (i) are separate modules of software -distributed in conjunction with the Program under their own license -agreement, and (ii) are not derivative works of the Program. - -"Contributor" means any person or entity that distributes the Program. - -"Licensed Patents" mean patent claims licensable by a Contributor which are -necessarily infringed by the use or sale of its Contribution alone or when -combined with the Program. - -"Program" means the Contributions distributed in accordance with this -Agreement. - -"Recipient" means anyone who receives the Program under this Agreement, -including all Contributors. - -2. GRANT OF RIGHTS - -a) Subject to the terms of this Agreement, each Contributor hereby grants -Recipient a non-exclusive, worldwide, royalty-free copyright license to -reproduce, prepare derivative works of, publicly display, publicly perform, -distribute and sublicense the Contribution of such Contributor, if any, and -such derivative works, in source code and object code form. - -b) Subject to the terms of this Agreement, each Contributor hereby grants -Recipient a non-exclusive, worldwide, royalty-free patent license under -Licensed Patents to make, use, sell, offer to sell, import and otherwise -transfer the Contribution of such Contributor, if any, in source code and -object code form. This patent license shall apply to the combination of the -Contribution and the Program if, at the time the Contribution is added by the -Contributor, such addition of the Contribution causes such combination to be -covered by the Licensed Patents. The patent license shall not apply to any -other combinations which include the Contribution. No hardware per se is -licensed hereunder. - -c) Recipient understands that although each Contributor grants the licenses -to its Contributions set forth herein, no assurances are provided by any -Contributor that the Program does not infringe the patent or other -intellectual property rights of any other entity. Each Contributor disclaims -any liability to Recipient for claims brought by any other entity based on -infringement of intellectual property rights or otherwise. As a condition to -exercising the rights and licenses granted hereunder, each Recipient hereby -assumes sole responsibility to secure any other intellectual property rights -needed, if any. For example, if a third party patent license is required to -allow Recipient to distribute the Program, it is Recipient's responsibility -to acquire that license before distributing the Program. - -d) Each Contributor represents that to its knowledge it has sufficient -copyright rights in its Contribution, if any, to grant the copyright license -set forth in this Agreement. - -3. REQUIREMENTS - -A Contributor may choose to distribute the Program in object code form under -its own license agreement, provided that: - -a) it complies with the terms and conditions of this Agreement; and - -b) its license agreement: - -i) effectively disclaims on behalf of all Contributors all warranties and -conditions, express and implied, including warranties or conditions of title -and non-infringement, and implied warranties or conditions of merchantability -and fitness for a particular purpose; - -ii) effectively excludes on behalf of all Contributors all liability for -damages, including direct, indirect, special, incidental and consequential -damages, such as lost profits; - -iii) states that any provisions which differ from this Agreement are offered -by that Contributor alone and not by any other party; and - -iv) states that source code for the Program is available from such -Contributor, and informs licensees how to obtain it in a reasonable manner on -or through a medium customarily used for software exchange. - -When the Program is made available in source code form: - -a) it must be made available under this Agreement; and - -b) a copy of this Agreement must be included with each copy of the Program. - -Contributors may not remove or alter any copyright notices contained within -the Program. - -Each Contributor must identify itself as the originator of its Contribution, -if any, in a manner that reasonably allows subsequent Recipients to identify -the originator of the Contribution. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain responsibilities with -respect to end users, business partners and the like. While this license is -intended to facilitate the commercial use of the Program, the Contributor who -includes the Program in a commercial product offering should do so in a -manner which does not create potential liability for other Contributors. -Therefore, if a Contributor includes the Program in a commercial product -offering, such Contributor ("Commercial Contributor") hereby agrees to defend -and indemnify every other Contributor ("Indemnified Contributor") against any -losses, damages and costs (collectively "Losses") arising from claims, -lawsuits and other legal actions brought by a third party against the -Indemnified Contributor to the extent caused by the acts or omissions of such -Commercial Contributor in connection with its distribution of the Program in -a commercial product offering. The obligations in this section do not apply -to any claims or Losses relating to any actual or alleged intellectual -property infringement. In order to qualify, an Indemnified Contributor must: -a) promptly notify the Commercial Contributor in writing of such claim, and -b) allow the Commercial Contributor tocontrol, and cooperate with the -Commercial Contributor in, the defense and any related settlement -negotiations. The Indemnified Contributor may participate in any such claim -at its own expense. - -For example, a Contributor might include the Program in a commercial product -offering, Product X. That Contributor is then a Commercial Contributor. If -that Commercial Contributor then makes performance claims, or offers -warranties related to Product X, those performance claims and warranties are -such Commercial Contributor's responsibility alone. Under this section, the -Commercial Contributor would have to defend claims against the other -Contributors related to those performance claims and warranties, and if a -court requires any other Contributor to pay any damages as a result, the -Commercial Contributor must pay those damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON -AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER -EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR -CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A -PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the -appropriateness of using and distributing the Program and assumes all risks -associated with its exercise of rights under this Agreement , including but -not limited to the risks and costs of program errors, compliance with -applicable laws, damage to or loss of data, programs or equipment, and -unavailability or interruption of operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY -CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION -LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE -EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY -OF SUCH DAMAGES. - -7. GENERAL - -If any provision of this Agreement is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of the -remainder of the terms of this Agreement, and without further action by the -parties hereto, such provision shall be reformed to the minimum extent -necessary to make such provision valid and enforceable. - -If Recipient institutes patent litigation against any entity (including a -cross-claim or counterclaim in a lawsuit) alleging that the Program itself -(excluding combinations of the Program with other software or hardware) -infringes such Recipient's patent(s), then such Recipient's rights granted -under Section 2(b) shall terminate as of the date such litigation is filed. - -All Recipient's rights under this Agreement shall terminate if it fails to -comply with any of the material terms or conditions of this Agreement and -does not cure such failure in a reasonable period of time after becoming -aware of such noncompliance. If all Recipient's rights under this Agreement -terminate, Recipient agrees to cease use and distribution of the Program as -soon as reasonably practicable. However, Recipient's obligations under this -Agreement and any licenses granted by Recipient relating to the Program shall -continue and survive. - -Everyone is permitted to copy and distribute copies of this Agreement, but in -order to avoid inconsistency the Agreement is copyrighted and may only be -modified in the following manner. The Agreement Steward reserves the right to -publish new versions (including revisions) of this Agreement from time to -time. No one other than the Agreement Steward has the right to modify this -Agreement. The Eclipse Foundation is the initial Agreement Steward. The -Eclipse Foundation may assign the responsibility to serve as the Agreement -Steward to a suitable separate entity. Each new version of the Agreement will -be given a distinguishing version number. The Program (including -Contributions) may always be distributed subject to the version of the -Agreement under which it was received. In addition, after a new version of -the Agreement is published, Contributor may elect to distribute the Program -(including its Contributions) under the new version. Except as expressly -stated in Sections 2(a) and 2(b) above, Recipient receives no rights or -licenses to the intellectual property of any Contributor under this -Agreement, whether expressly, by implication, estoppel or otherwise. All -rights in the Program not expressly granted under this Agreement are -reserved. - -This Agreement is governed by the laws of the State of New York and the -intellectual property laws of the United States of America. No party to this -Agreement will bring a legal action under this Agreement more than one year -after the cause of action arose. Each party waives its rights to a jury trial -in any resulting litigation. diff --git a/syng-im/README.md b/syng-im/README.md deleted file mode 100644 index 19e1fbc53f..0000000000 --- a/syng-im/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# syng-im - -A Clojure library designed to ... well, that part is up to you. - -## Usage - -FIXME - -## License - -Copyright © 2016 FIXME - -Distributed under the Eclipse Public License either version 1.0 or (at -your option) any later version. diff --git a/syng-im/android/app/build.gradle b/syng-im/android/app/build.gradle deleted file mode 100644 index 9f152c2e9b..0000000000 --- a/syng-im/android/app/build.gradle +++ /dev/null @@ -1,134 +0,0 @@ -apply plugin: "com.android.application" - -import com.android.build.OutputFile - -/** - * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets - * and bundleReleaseJsAndAssets). - * These basically call `react-native bundle` with the correct arguments during the Android build - * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the - * bundle directly from the development server. Below you can see all the possible configurations - * and their defaults. If you decide to add a configuration block, make sure to add it before the - * `apply from: "react.gradle"` line. - * - * project.ext.react = [ - * // the name of the generated asset file containing your JS bundle - * bundleAssetName: "index.android.bundle", - * - * // the entry file for bundle generation - * entryFile: "index.android.js", - * - * // whether to bundle JS and assets in debug mode - * bundleInDebug: false, - * - * // whether to bundle JS and assets in release mode - * bundleInRelease: true, - * - * // whether to bundle JS and assets in another build variant (if configured). - * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants - * // The configuration property is in the format 'bundleIn${productFlavor}${buildType}' - * // bundleInFreeDebug: true, - * // bundleInPaidRelease: true, - * // bundleInBeta: true, - * - * // the root of your project, i.e. where "package.json" lives - * root: "../../", - * - * // where to put the JS bundle asset in debug mode - * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", - * - * // where to put the JS bundle asset in release mode - * jsBundleDirRelease: "$buildDir/intermediates/assets/release", - * - * // where to put drawable resources / React Native assets, e.g. the ones you use via - * // require('./image.png')), in debug mode - * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", - * - * // where to put drawable resources / React Native assets, e.g. the ones you use via - * // require('./image.png')), in release mode - * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", - * - * // by default the gradle tasks are skipped if none of the JS files or assets change; this means - * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to - * // date; if you have any other folders that you want to ignore for performance reasons (gradle - * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ - * // for example, you might want to remove it from here. - * inputExcludes: ["android/**", "ios/**"] - * ] - */ - -apply from: "react.gradle" - -/** - * Set this to true to create three separate APKs instead of one: - * - A universal APK that works on all devices - * - An APK that only works on ARM devices - * - An APK that only works on x86 devices - * The advantage is the size of the APK is reduced by about 4MB. - * Upload all the APKs to the Play Store and people will download - * the correct one based on the CPU architecture of their device. - */ -def enableSeparateBuildPerCPUArchitecture = false - -/** - * Run Proguard to shrink the Java bytecode in release builds. - */ -def enableProguardInReleaseBuilds = false - -android { - compileSdkVersion 23 - buildToolsVersion "23.0.1" - - defaultConfig { - applicationId "com.syngim" - minSdkVersion 16 - targetSdkVersion 22 - versionCode 1 - versionName "1.0" - ndk { - abiFilters "armeabi-v7a", "x86" - } - } - splits { - abi { - enable enableSeparateBuildPerCPUArchitecture - universalApk false - reset() - include "armeabi-v7a", "x86" - } - } - buildTypes { - release { - minifyEnabled enableProguardInReleaseBuilds - proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" - } - } - // applicationVariants are e.g. debug, release - applicationVariants.all { variant -> - variant.outputs.each { output -> - // For each separate APK per architecture, set a unique version code as described here: - // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits - def versionCodes = ["armeabi-v7a":1, "x86":2] - def abi = output.getFilter(OutputFile.ABI) - if (abi != null) { // null for the universal-debug, universal-release variants - output.versionCodeOverride = - versionCodes.get(abi) * 1048576 + defaultConfig.versionCode - } - } - } -} - -dependencies { - compile project(':randombytes') - compile project(':realm') - compile project(':react-native-vector-icons') - compile fileTree(dir: "libs", include: ["*.jar"]) - compile "com.android.support:appcompat-v7:23.0.1" - compile "com.facebook.react:react-native:+" // From node_modules - compile project(':react-native-contacts') - compile project(':react-native-i18n') -// compile(name:'geth', ext:'aar') - compile(group: 'syng-im', name: 'android-geth', version: '1.4.0-201603131817-92d65cf', ext: 'aar') - - compile fileTree(dir: "node_modules/realm/android/libs", include: ["*.jar"]) -} diff --git a/syng-im/android/app/proguard-rules.pro b/syng-im/android/app/proguard-rules.pro deleted file mode 100644 index 7d72e46927..0000000000 --- a/syng-im/android/app/proguard-rules.pro +++ /dev/null @@ -1,67 +0,0 @@ -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Disabling obfuscation is useful if you collect stack traces from production crashes -# (unless you are using a system that supports de-obfuscate the stack traces). --dontobfuscate - -# React Native - -# Keep our interfaces so they can be used by other ProGuard rules. -# See http://sourceforge.net/p/proguard/bugs/466/ --keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip --keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters - -# Do not strip any method/class that is annotated with @DoNotStrip --keep @com.facebook.proguard.annotations.DoNotStrip class * --keepclassmembers class * { - @com.facebook.proguard.annotations.DoNotStrip *; -} - --keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { - void set*(***); - *** get*(); -} - --keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } --keep class * extends com.facebook.react.bridge.NativeModule { *; } --keepclassmembers,includedescriptorclasses class * { native ; } --keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } --keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; } --keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; } - --dontwarn com.facebook.react.** - -# okhttp - --keepattributes Signature --keepattributes *Annotation* --keep class com.squareup.okhttp.** { *; } --keep interface com.squareup.okhttp.** { *; } --dontwarn com.squareup.okhttp.** - -# okio - --keep class sun.misc.Unsafe { *; } --dontwarn java.nio.file.* --dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement --dontwarn okio.** - -# stetho - --dontwarn com.facebook.stetho.** diff --git a/syng-im/android/app/react.gradle b/syng-im/android/app/react.gradle deleted file mode 100644 index 4b43bf910c..0000000000 --- a/syng-im/android/app/react.gradle +++ /dev/null @@ -1,96 +0,0 @@ -import org.apache.tools.ant.taskdefs.condition.Os - -def config = project.hasProperty("react") ? project.react : []; - -def bundleAssetName = config.bundleAssetName ?: "index.android.bundle" -def entryFile = config.entryFile ?: "index.android.js" - -// because elvis operator -def elvisFile(thing) { - return thing ? file(thing) : null; -} - -def reactRoot = elvisFile(config.root) ?: file("../../") -def inputExcludes = config.inputExcludes ?: ["android/**", "ios/**"] - -void runBefore(String dependentTaskName, Task task) { - Task dependentTask = tasks.findByPath(dependentTaskName); - if (dependentTask != null) { - dependentTask.dependsOn task - } -} - -gradle.projectsEvaluated { - // Grab all build types and product flavors - def buildTypes = android.buildTypes.collect { type -> type.name } - def productFlavors = android.productFlavors.collect { flavor -> flavor.name } - - // When no product flavors defined, use empty - if (!productFlavors) productFlavors.add('') - - productFlavors.each { productFlavorName -> - buildTypes.each { buildTypeName -> - // Create variant and source names - def sourceName = "${buildTypeName}" - def targetName = "${sourceName.capitalize()}" - if (productFlavorName) { - sourceName = "${productFlavorName}${targetName}" - } - - // React js bundle directories - def jsBundleDirConfigName = "jsBundleDir${targetName}" - def jsBundleDir = elvisFile(config."$jsBundleDirConfigName") ?: - file("$buildDir/intermediates/assets/${sourceName}") - - def resourcesDirConfigName = "jsBundleDir${targetName}" - def resourcesDir = elvisFile(config."${resourcesDirConfigName}") ?: - file("$buildDir/intermediates/res/merged/${sourceName}") - def jsBundleFile = file("$jsBundleDir/$bundleAssetName") - - // Bundle task name for variant - def bundleJsAndAssetsTaskName = "bundle${targetName}JsAndAssets" - - def currentBundleTask = tasks.create( - name: bundleJsAndAssetsTaskName, - type: Exec) { - group = "react" - description = "bundle JS and assets for ${targetName}." - - // Create dirs if they are not there (e.g. the "clean" task just ran) - doFirst { - jsBundleDir.mkdirs() - resourcesDir.mkdirs() - } - - // Set up inputs and outputs so gradle can cache the result - inputs.files fileTree(dir: reactRoot, excludes: inputExcludes) - outputs.dir jsBundleDir - outputs.dir resourcesDir - - // Set up the call to the react-native cli - workingDir reactRoot - - // Set up dev mode - def devEnabled = !targetName.toLowerCase().contains("release") - if (Os.isFamily(Os.FAMILY_WINDOWS)) { - commandLine "cmd", "/c", "react-native", "bundle", "--platform", "android", "--dev", "${devEnabled}", - "--entry-file", entryFile, "--bundle-output", jsBundleFile, "--assets-dest", resourcesDir - } else { - commandLine "react-native", "bundle", "--platform", "android", "--dev", "${devEnabled}", - "--entry-file", entryFile, "--bundle-output", jsBundleFile, "--assets-dest", resourcesDir - } - - enabled config."bundleIn${targetName}" ?: targetName.toLowerCase().contains("release") - } - - // Hook bundle${productFlavor}${buildType}JsAndAssets into the android build process - currentBundleTask.dependsOn("merge${targetName}Resources") - currentBundleTask.dependsOn("merge${targetName}Assets") - - runBefore("processArmeabi-v7a${targetName}Resources", currentBundleTask) - runBefore("processX86${targetName}Resources", currentBundleTask) - runBefore("processUniversal${targetName}Resources", currentBundleTask) - runBefore("process${targetName}Resources", currentBundleTask) - } - } -} diff --git a/syng-im/android/app/src/main/AndroidManifest.xml b/syng-im/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index c56b2f64b8..0000000000 --- a/syng-im/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/syng-im/android/app/src/main/assets/fonts/Avenir-Roman.ttf b/syng-im/android/app/src/main/assets/fonts/Avenir-Roman.ttf deleted file mode 100644 index f58eeaab87..0000000000 Binary files a/syng-im/android/app/src/main/assets/fonts/Avenir-Roman.ttf and /dev/null differ diff --git a/syng-im/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/syng-im/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index cde69bccce..0000000000 Binary files a/syng-im/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/syng-im/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/syng-im/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index c133a0cbd3..0000000000 Binary files a/syng-im/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/syng-im/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/syng-im/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index bfa42f0e7b..0000000000 Binary files a/syng-im/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/syng-im/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/syng-im/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index 324e72cdd7..0000000000 Binary files a/syng-im/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/syng-im/android/app/src/main/res/values/strings.xml b/syng-im/android/app/src/main/res/values/strings.xml deleted file mode 100644 index 7b66980444..0000000000 --- a/syng-im/android/app/src/main/res/values/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - SyngIm - diff --git a/syng-im/android/app/src/main/res/values/styles.xml b/syng-im/android/app/src/main/res/values/styles.xml deleted file mode 100644 index 319eb0ca10..0000000000 --- a/syng-im/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/syng-im/android/build.gradle b/syng-im/android/build.gradle deleted file mode 100644 index f05bf1a9b7..0000000000 --- a/syng-im/android/build.gradle +++ /dev/null @@ -1,31 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - repositories { - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:1.3.1' - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - mavenLocal() - jcenter() - maven { - // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm - url "$projectDir/../../node_modules/react-native/android" - } - // for geth - flatDir { - dirs 'libs' - } - maven { - url "http://85.90.244.96:8081/artifactory/libs-release-local" - } - } -} diff --git a/syng-im/android/gradle.properties b/syng-im/android/gradle.properties deleted file mode 100644 index 1fd964e90b..0000000000 --- a/syng-im/android/gradle.properties +++ /dev/null @@ -1,20 +0,0 @@ -# Project-wide Gradle settings. - -# IDE (e.g. Android Studio) users: -# Gradle settings configured through the IDE *will override* -# any settings specified in this file. - -# For more details on how to configure your build environment visit -# http://www.gradle.org/docs/current/userguide/build_environment.html - -# Specifies the JVM arguments used for the daemon process. -# The setting is particularly useful for tweaking memory settings. -# Default value: -Xmx10248m -XX:MaxPermSize=256m -# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 - -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true - -android.useDeprecatedNdk=true diff --git a/syng-im/android/gradle/wrapper/gradle-wrapper.jar b/syng-im/android/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index b5166dad4d..0000000000 Binary files a/syng-im/android/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/syng-im/android/gradle/wrapper/gradle-wrapper.properties b/syng-im/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index b9fbfaba0e..0000000000 --- a/syng-im/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip diff --git a/syng-im/android/gradlew b/syng-im/android/gradlew deleted file mode 100755 index 91a7e269e1..0000000000 --- a/syng-im/android/gradlew +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if $cygwin ; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >&- -APP_HOME="`pwd -P`" -cd "$SAVED" >&- - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" - -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/syng-im/android/gradlew.bat b/syng-im/android/gradlew.bat deleted file mode 100644 index aec99730b4..0000000000 --- a/syng-im/android/gradlew.bat +++ /dev/null @@ -1,90 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/syng-im/android/settings.gradle b/syng-im/android/settings.gradle deleted file mode 100644 index 784925e19a..0000000000 --- a/syng-im/android/settings.gradle +++ /dev/null @@ -1,16 +0,0 @@ -rootProject.name = 'SyngIm' - -include ':app' - -include ':react-native-contacts' -project(':react-native-contacts').projectDir = new File(settingsDir, '../node_modules/react-native-contacts/android') - -include ':react-native-i18n' -project(':react-native-i18n').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-i18n/android') -// realm dependency -include ':react-native-vector-icons' -project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android') -include ':realm' -project(':realm').projectDir = new File(rootProject.projectDir, '../node_modules/realm/android') -include ':randombytes' -project(':randombytes').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-randombytes/app') \ No newline at end of file diff --git a/syng-im/doc/intro.md b/syng-im/doc/intro.md deleted file mode 100644 index 7a0eb4e81c..0000000000 --- a/syng-im/doc/intro.md +++ /dev/null @@ -1,3 +0,0 @@ -# Introduction to syng-im - -TODO: write [great documentation](http://jacobian.org/writing/what-to-write/) diff --git a/syng-im/env/dev/env/android/main.cljs b/syng-im/env/dev/env/android/main.cljs deleted file mode 100644 index 2348604c4a..0000000000 --- a/syng-im/env/dev/env/android/main.cljs +++ /dev/null @@ -1,18 +0,0 @@ - (ns ^:figwheel-no-load env.android.main - (:require [reagent.core :as r] - [syng-im.android.core :refer [app-root]] - [figwheel.client :as figwheel :include-macros true] - [syng-im.android.core :as core])) - - (enable-console-print!) - -(def cnt (r/atom 0)) -(defn reloader [] @cnt [app-root]) -(def root-el (r/as-element [reloader])) - -(figwheel/watch-and-reload - :websocket-url "ws://10.0.3.2:3449/figwheel-ws" - :heads-up-display true - :jsload-callback #(swap! cnt inc)) - -(core/init) \ No newline at end of file diff --git a/syng-im/env/dev/env/ios/main.cljs b/syng-im/env/dev/env/ios/main.cljs deleted file mode 100644 index 748936a414..0000000000 --- a/syng-im/env/dev/env/ios/main.cljs +++ /dev/null @@ -1,17 +0,0 @@ - (ns ^:figwheel-no-load env.ios.main - (:require [reagent.core :as r] - [syng-im.ios.core :as core] - [figwheel.client :as figwheel :include-macros true])) - - (enable-console-print!) - -(def cnt (r/atom 0)) -(defn reloader [] @cnt [core/app-root]) -(def root-el (r/as-element [reloader])) - -(figwheel/watch-and-reload - :websocket-url "ws://localhost:3449/figwheel-ws" - :heads-up-display true - :jsload-callback #(swap! cnt inc)) - -(core/init) \ No newline at end of file diff --git a/syng-im/env/dev/user.clj b/syng-im/env/dev/user.clj deleted file mode 100644 index 4c2ca8be74..0000000000 --- a/syng-im/env/dev/user.clj +++ /dev/null @@ -1,26 +0,0 @@ -(ns user - (:use [figwheel-sidecar.repl-api :as ra])) -;; This namespace is loaded automatically by nREPL - -;; read project.clj to get build configs -(def profiles (->> "project.clj" - slurp - read-string - (drop-while #(not= % :profiles)) - (apply hash-map) - :profiles)) - -(def cljs-builds (get-in profiles [:dev :cljsbuild :builds])) - -(defn start-figwheel - "Start figwheel for one or more builds" - [& build-ids] - (ra/start-figwheel! - {:build-ids build-ids - :all-builds cljs-builds}) - (ra/cljs-repl)) - -(defn stop-figwheel - "Stops figwheel" - [] - (ra/stop-figwheel!)) \ No newline at end of file diff --git a/syng-im/env/prod/env/android/main.cljs b/syng-im/env/prod/env/android/main.cljs deleted file mode 100644 index f112100ec7..0000000000 --- a/syng-im/env/prod/env/android/main.cljs +++ /dev/null @@ -1,6 +0,0 @@ - (ns env.android.main - (:require [syng-im.android.core :as core])) - - (core/init) - - diff --git a/syng-im/env/prod/env/ios/main.cljs b/syng-im/env/prod/env/ios/main.cljs deleted file mode 100644 index 11392b5e72..0000000000 --- a/syng-im/env/prod/env/ios/main.cljs +++ /dev/null @@ -1,6 +0,0 @@ - (ns env.ios.main - (:require [syng-im.ios.core :as core])) - - (core/init) - - diff --git a/syng-im/figwheel-bridge.js b/syng-im/figwheel-bridge.js deleted file mode 100644 index 2a7cb1cc2f..0000000000 --- a/syng-im/figwheel-bridge.js +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Originally taken from https://github.com/decker405/figwheel-react-native - * - * @providesModule figwheel-bridge - */ - -var CLOSURE_UNCOMPILED_DEFINES = null; - -var config = { - basePath: "target/", - googBasePath: 'goog/', - serverPort: 8081 -}; - -var React = require('react-native'); -var self; -var scriptQueue = []; -var serverHost = null; // will be set dynamically -var fileBasePath = null; // will be set dynamically -var evaluate = eval; // This is needed, direct calls to eval does not work (RN packager???) -var externalModules = {}; -var evalListeners = []; // functions to be called when a script is evaluated - -var figwheelApp = function (platform, devHost) { - return React.createClass({ - getInitialState: function () { - return {loaded: false} - }, - render: function () { - if (!this.state.loaded) { - var plainStyle = {flex: 1, alignItems: 'center', justifyContent: 'center'}; - return ( - - Waiting for Figwheel to load files. - - ); - } - return this.state.root; - }, - componentDidMount: function () { - var app = this; - if (typeof goog === "undefined") { - loadApp(platform, devHost, function(appRoot) { - app.setState({root: appRoot, loaded: true}) - }); - } - } - }) -}; - -// evaluates js code ensuring proper ordering -function customEval(url, javascript, success, error) { - if (scriptQueue.length > 0) { - if (scriptQueue[0] === url) { - try { - evaluate(javascript); - console.info('Evaluated: ' + url); - scriptQueue.shift(); - evalListeners.forEach(function (listener) { - listener(url) - }); - success(); - } catch (e) { - console.error('Evaluation error in: ' + url); - console.error(e); - error(); - } - } else { - setTimeout(function () { - customEval(url, javascript, success, error) - }, 5); - } - } else { - console.error('Something bad happened...'); - error() - } -} - -var isChrome = function () { - return typeof importScripts === "function" -}; - -function asyncImportScripts(url, success, error) { - console.info('(asyncImportScripts) Importing: ' + url); - scriptQueue.push(url); - fetch(url) - .then(function (response) { - return response.text() - }) - .then(function (responseText) { - return customEval(url, responseText, success, error); - }) - .catch(function (error) { - console.error('Error loading script, please check your config setup.'); - console.error(error); - return error(); - }); -} - -function syncImportScripts(url, success, error) { - try { - importScripts(url); - console.info('Evaluated: ' + url); - evalListeners.forEach(function (listener) { - listener(url) - }); - success(); - } catch (e) { - error() - } -} - -// Loads js file sync if possible or async. -function importJs(src, success, error) { - if (typeof success !== 'function') { - success = function () { - }; - } - if (typeof error !== 'function') { - error = function () { - }; - } - - var file = fileBasePath + '/' + src; - - console.info('(importJs) Importing: ' + file); - if (isChrome()) { - syncImportScripts(serverBaseUrl("localhost") + '/' + file, success, error); - } else { - asyncImportScripts(serverBaseUrl(serverHost) + '/' + file, success, error); - } -} - -function interceptRequire() { - var oldRequire = window.require; - console.info("Shimming require"); - window.require = function (id) { - console.info("Requiring: " + id); - if (externalModules[id]) { - return externalModules[id]; - } - return oldRequire(id); - }; -} - -// do not show debug messages in yellow box -function debugToLog() { - console.debug = console.log; -} - -function serverBaseUrl(host) { - return "http://" + host + ":" + config.serverPort -} - -function loadApp(platform, devHost, onLoadCb) { - serverHost = devHost; - fileBasePath = config.basePath + platform; - - evalListeners.push(function (url) { - if (url.indexOf('jsloader') > -1) { - shimJsLoader(); - } - }); - - // callback when app is ready to get the reloadable component - var mainJs = '/env/' + platform + '/main.js'; - evalListeners.push(function (url) { - if (url.indexOf(mainJs) > -1) { - onLoadCb(env[platform].main.root_el); - console.log('Done loading Clojure app'); - } - }); - - if (typeof goog === "undefined") { - console.log('Loading Closure base.'); - interceptRequire(); - importJs('goog/base.js', function () { - shimBaseGoog(); - fakeLocalStorageAndDocument(); - importJs('cljs_deps.js'); - importJs('goog/deps.js', function () { - debugToLog(); - // This is needed because of RN packager - // seriously React packager? why. - var googreq = goog.require; - - googreq('figwheel.connect'); - }); - }); - } -} - -function startApp(appName, platform, devHost) { - React.AppRegistry.registerComponent( - appName, () => figwheelApp(platform, devHost)); -} - -function withModules(moduleById) { - externalModules = moduleById; - return self; -} - -// Goog fixes -function shimBaseGoog() { - console.info('Shimming goog functions.'); - goog.basePath = 'goog/'; - goog.writeScriptSrcNode = importJs; - goog.writeScriptTag_ = function (src, optSourceText) { - importJs(src); - return true; - }; - goog.inHtmlDocument_ = function () { - return true; - }; -} - -function fakeLocalStorageAndDocument() { - window.localStorage = {}; - window.localStorage.getItem = function () { - return 'true'; - }; - window.localStorage.setItem = function () { - }; - - window.document = {}; - window.document.body = {}; - window.document.body.dispatchEvent = function () { - }; - window.document.createElement = function () { - }; - - if (typeof window.location === 'undefined') { - window.location = {}; - } - console.debug = console.warn; - window.addEventListener = function () { - }; - // make figwheel think that heads-up-display divs are there - window.document.querySelector = function (selector) { - return {}; - }; - window.document.getElementById = function (id) { - return {style:{}}; - }; -} - -// Figwheel fixes -// Used by figwheel - uses importScript to load JS rather than