commit
ce6ebde8b7
|
@ -17,6 +17,9 @@ import com.bitgo.randombytes.RandomBytesPackage;
|
||||||
import com.BV.LinearGradient.LinearGradientPackage;
|
import com.BV.LinearGradient.LinearGradientPackage;
|
||||||
import com.centaurwarchief.smslistener.SmsListener;
|
import com.centaurwarchief.smslistener.SmsListener;
|
||||||
|
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
@ -29,6 +32,7 @@ import io.realm.react.RealmReactPackage;
|
||||||
|
|
||||||
public class MainActivity extends ReactActivity {
|
public class MainActivity extends ReactActivity {
|
||||||
|
|
||||||
|
final Handler handler = new Handler();
|
||||||
|
|
||||||
protected void startStatus() {
|
protected void startStatus() {
|
||||||
// Required for android-16 (???)
|
// Required for android-16 (???)
|
||||||
|
@ -47,11 +51,19 @@ public class MainActivity extends ReactActivity {
|
||||||
getApplicationInfo().dataDir;
|
getApplicationInfo().dataDir;
|
||||||
|
|
||||||
// Launch!
|
// Launch!
|
||||||
|
final Runnable addPeer = new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
Log.w("Geth", "adding peer");
|
||||||
|
Geth.run("--exec admin.addPeer(\"enode://e2f28126720452aa82f7d3083e49e6b3945502cb94d9750a15e27ee310eed6991618199f878e5fbc7dfa0e20f0af9554b41f491dc8f1dbae8f0f2d37a3a613aa@139.162.13.89:55555\") attach http://localhost:8545");
|
||||||
|
}
|
||||||
|
};
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
Geth.run("--bootnodes enode://e2f28126720452aa82f7d3083e49e6b3945502cb94d9750a15e27ee310eed6991618199f878e5fbc7dfa0e20f0af9554b41f491dc8f1dbae8f0f2d37a3a613aa@139.162.13.89:30303 --shh --ipcdisable --nodiscover --rpc --rpcapi db,eth,net,web3,shh,admin --fast --datadir=" + dataFolder);
|
Geth.run("--shh --ipcdisable --nodiscover --rpc --rpcapi db,eth,net,web3,shh,admin --fast --datadir=" + dataFolder);
|
||||||
|
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
|
handler.postDelayed(addPeer, 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">Status</string>
|
<string name="app_name">Status</string>
|
||||||
<string name="root_warning">Your phone appears to be ROOTED, this is a serious security concern, continue only if you understand and accept the risks.</string>
|
<string name="root_warning">Your phone appears to be ROOTED, by pressing CONTINUE you understand and accept the risks in using this software.</string>
|
||||||
<string name="root_okay">Continue</string>
|
<string name="root_okay">Continue</string>
|
||||||
<string name="root_cancel">Exit</string>
|
<string name="root_cancel">Exit</string>
|
||||||
</resources>
|
</resources>
|
|
@ -230,9 +230,9 @@
|
||||||
(sign-up-service/stop-listening-confirmation-code-sms db)))
|
(sign-up-service/stop-listening-confirmation-code-sms db)))
|
||||||
|
|
||||||
(register-handler :sign-up-confirm
|
(register-handler :sign-up-confirm
|
||||||
(fn [db [_ confirmation-code]]
|
(u/side-effect!
|
||||||
(server/sign-up-confirm confirmation-code sign-up-service/on-send-code-response)
|
(fn [_ [_ confirmation-code]]
|
||||||
db))
|
(server/sign-up-confirm confirmation-code sign-up-service/on-send-code-response))))
|
||||||
|
|
||||||
(register-handler :set-signed-up
|
(register-handler :set-signed-up
|
||||||
(fn [db [_ signed-up]]
|
(fn [db [_ signed-up]]
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
[drawer-view
|
[drawer-view
|
||||||
[view st/chats-container
|
[view st/chats-container
|
||||||
[chats-list-toolbar]
|
[chats-list-toolbar]
|
||||||
[list-view {:dataSource (to-datasource (vals @chats))
|
[list-view {:dataSource (to-datasource @chats)
|
||||||
:renderRow (fn [row _ _]
|
:renderRow (fn [row _ _]
|
||||||
(list-item [chat-list-item row]))
|
(list-item [chat-list-item row]))
|
||||||
:style st/list-container}]
|
:style st/list-container}]
|
||||||
|
|
|
@ -1,17 +1,18 @@
|
||||||
(ns status-im.chats-list.views.chat-list-item
|
(ns status-im.chats-list.views.chat-list-item
|
||||||
(:require [re-frame.core :refer [subscribe dispatch dispatch-sync]]
|
(:require [re-frame.core :refer [subscribe dispatch dispatch-sync]]
|
||||||
[status-im.components.react :refer [view
|
[status-im.components.react :refer [view
|
||||||
text
|
text
|
||||||
image
|
image
|
||||||
touchable-highlight]]
|
touchable-highlight]]
|
||||||
[status-im.components.styles :refer [font]]
|
[status-im.components.styles :refer [font]]
|
||||||
[status-im.chats-list.views.inner-item :refer
|
[status-im.chats-list.views.inner-item :refer
|
||||||
[chat-list-item-inner-view]]))
|
[chat-list-item-inner-view]]))
|
||||||
|
|
||||||
(defn chat-list-item [{:keys [chat-id] :as chat}]
|
(defn chat-list-item [[chat-id chat]]
|
||||||
[touchable-highlight
|
[touchable-highlight
|
||||||
{:on-press #(dispatch [:navigate-to :chat chat-id])}
|
{:on-press #(dispatch [:navigate-to :chat chat-id])}
|
||||||
[view [chat-list-item-inner-view (merge chat
|
[view [chat-list-item-inner-view (merge chat
|
||||||
;; TODO stub data
|
;; TODO stub data
|
||||||
{:new-messages-count 3
|
{:chat-id chat-id
|
||||||
|
:new-messages-count 3
|
||||||
:online true})]]])
|
:online true})]]])
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
image
|
image
|
||||||
icon]]
|
icon]]
|
||||||
[status-im.components.chat-icon.styles :as st]
|
[status-im.components.chat-icon.styles :as st]
|
||||||
[status-im.components.styles :refer [color-purple]]))
|
[status-im.components.styles :refer [color-purple]]
|
||||||
|
[clojure.string :as s]))
|
||||||
|
|
||||||
(defn default-chat-icon [name styles]
|
(defn default-chat-icon [name styles]
|
||||||
[view (:default-chat-icon styles)
|
[view (:default-chat-icon styles)
|
||||||
|
@ -26,10 +27,10 @@
|
||||||
(defview chat-icon-view [chat-id group-chat name online styles]
|
(defview chat-icon-view [chat-id group-chat name online styles]
|
||||||
[photo-path [:chat-photo chat-id]]
|
[photo-path [:chat-photo chat-id]]
|
||||||
[view (:container styles)
|
[view (:container styles)
|
||||||
(if (and photo-path (not (empty? photo-path)))
|
(if-not (s/blank? photo-path)
|
||||||
[chat-icon photo-path styles]
|
[chat-icon photo-path styles]
|
||||||
[default-chat-icon name styles])
|
[default-chat-icon name styles])
|
||||||
(when (not group-chat)
|
(when-not group-chat
|
||||||
[contact-online online styles])])
|
[contact-online online styles])])
|
||||||
|
|
||||||
(defn chat-icon-view-chat-list [chat-id group-chat name color online]
|
(defn chat-icon-view-chat-list [chat-id group-chat name color online]
|
||||||
|
@ -80,7 +81,7 @@
|
||||||
[contact [:contact]]
|
[contact [:contact]]
|
||||||
(let [;; TODO stub data
|
(let [;; TODO stub data
|
||||||
online true
|
online true
|
||||||
color color-purple]
|
color color-purple]
|
||||||
[profile-icon-view (:photo-path contact) (:name contact) color online]))
|
[profile-icon-view (:photo-path contact) (:name contact) color online]))
|
||||||
|
|
||||||
(defview my-profile-icon []
|
(defview my-profile-icon []
|
||||||
|
@ -88,5 +89,5 @@
|
||||||
photo-path [:get :photo-path]]
|
photo-path [:get :photo-path]]
|
||||||
(let [;; TODO stub data
|
(let [;; TODO stub data
|
||||||
online true
|
online true
|
||||||
color color-purple]
|
color color-purple]
|
||||||
[profile-icon-view photo-path name color online]))
|
[profile-icon-view photo-path name color online]))
|
||||||
|
|
|
@ -92,10 +92,14 @@
|
||||||
(defn add-new-contacts
|
(defn add-new-contacts
|
||||||
[{:keys [contacts] :as db} [_ new-contacts]]
|
[{:keys [contacts] :as db} [_ new-contacts]]
|
||||||
(let [identities (set (map :whisper-identity contacts))
|
(let [identities (set (map :whisper-identity contacts))
|
||||||
new-contacts' (remove #(identities (:whisper-identity %)) new-contacts)]
|
new-contacts' (->> new-contacts
|
||||||
|
(remove #(identities (:whisper-identity %)))
|
||||||
|
(map #(vector (:whisper-identity %) %))
|
||||||
|
(into {}))]
|
||||||
|
(println new-contacts')
|
||||||
(-> db
|
(-> db
|
||||||
(update :contacts concat new-contacts')
|
(update :contacts merge new-contacts')
|
||||||
(assoc :new-contacts new-contacts'))))
|
(assoc :new-contacts (vals new-contacts')))))
|
||||||
|
|
||||||
(register-handler :add-contacts
|
(register-handler :add-contacts
|
||||||
(after save-contacts!)
|
(after save-contacts!)
|
||||||
|
|
Loading…
Reference in New Issue