Skip to content

Commit

Permalink
Merge pull request #571 from status-im/bug/#570
Browse files Browse the repository at this point in the history
Fix for "Add to contacts" request (#570)
  • Loading branch information
rasom authored Dec 21, 2016
2 parents 4a54a2f + 5547fd6 commit 7fb7b60
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
5 changes: 0 additions & 5 deletions src/status_im/chat/handlers.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -438,11 +438,6 @@
(dispatch [::start-chat! contact-id options navigation-type]))))))

(register-handler :add-chat
(u/side-effect!
(fn [_ [_ chat-id chat]]
(dispatch [::add-chat chat-id chat]))))

(register-handler ::add-chat
(-> add-new-chat
((enrich add-chat))
((after save-new-chat!))))
Expand Down
26 changes: 13 additions & 13 deletions src/status_im/protocol/handlers.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -385,19 +385,19 @@
(let [{{:keys [name profile-image address status]} :contact
{:keys [public private]} :keypair} payload

contact {:whisper-identity from
:public-key public
:private-key private
:address address
:status status
:photo-path profile-image
:name name}
contact-exist? (get contacts from)
chat {:name name
:chat-id from
:contact-info (prn-str contact)
:pending-contact? true}]
(if contact-exist?
contact {:whisper-identity from
:public-key public
:private-key private
:address address
:status status
:photo-path profile-image
:name name}
contact-exists? (get contacts from)
chat {:name name
:chat-id from
:contact-info (prn-str contact)
:pending-contact? true}]
(if contact-exists?
(do
(dispatch [:update-contact! contact])
(dispatch [:watch-contact contact]))
Expand Down

0 comments on commit 7fb7b60

Please sign in to comment.