OpenBazaar / OpenBazaar-Server

(Deprecated) OpenBazaar 1.0 Server daemon for communication with OpenBazaar-Client
MIT License
608 stars 173 forks source link

Add API to remove a conversation. #265

Open rmisio opened 8 years ago

rmisio commented 8 years ago

Please add in an API that would allow a conversation to be "removed" from the sidebar on the client. Essentially, something that allows the client to set a "removed" flag on a conversation which would exclude it from being returned in the get_chat_conversations API call. The flag should be automatically reset to false if a new message is added to the conversation (regardless which side sends the message).

Client side issue: https://github.com/OpenBazaar/OpenBazaar-Client/issues/342

jjeffryes commented 8 years ago

This was actually added recently.

@DELETE('^/api/v1/chat_conversation')

My understanding is it completely removes the conversation.

rmisio commented 8 years ago

That API call would allows us to "Clear a conversation", essentially clear the history of a convo (i.e. delete all the messages). My understanding is "Removing a conversation from the sidebar" is a different thing, in that it would remove the convo (and chat head) from the UI, but the history would be in tact. The next time a message comes through in the convo (from either side), the convo and chat head are added back to the UI.

At least, that's how the big boy chat apps (Skype, Slack) seem to do it.

drwasho commented 8 years ago

@rmisio removing a chat from the side bar without clearing the conversation is a backend or frontend issue?

rmisio commented 8 years ago

@drwasho it's both. The backend would need to provide an API and then the front-end would need to consume it (I imagine via a little 'X' on the chat head).