no inbox with self
This commit is contained in:
parent
c64e6d247c
commit
cfd1116625
|
@ -32,13 +32,18 @@ final class Msg(
|
|||
env.msg.api.convoWith(me, username) flatMap { convo =>
|
||||
def newJson = inboxJson(me).map { _ + ("convo" -> env.msg.json.convo(convo)) }
|
||||
negotiate(
|
||||
html = newJson map { json =>
|
||||
Ok(views.html.msg.home(json))
|
||||
},
|
||||
api = v => {
|
||||
if (v >= 5) newJson
|
||||
else fuccess(env.msg.compat.thread(me, convo))
|
||||
} map { Ok(_) }
|
||||
html =
|
||||
if (convo.contact.id == me.id) Redirect(routes.Msg.home).fuccess
|
||||
else
|
||||
newJson map { json =>
|
||||
Ok(views.html.msg.home(json))
|
||||
},
|
||||
api = v =>
|
||||
if (convo.contact.id == me.id) notFoundJson()
|
||||
else {
|
||||
if (v >= 5) newJson
|
||||
else fuccess(env.msg.compat.thread(me, convo))
|
||||
} map { Ok(_) }
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ final class MsgSearch(
|
|||
.Result(
|
||||
threads,
|
||||
friends.filterNot(f => threads.exists(_.other(me) == f.id)) take 10,
|
||||
users.filterNot(u => friends.exists(_.id == u.id)) take 10
|
||||
users.filterNot(u => u.id == me.id || friends.exists(_.id == u.id)) take 10
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue