On Tuesday, September 27, 2016 at 2:24:46 PM UTC-7, Alex Glaros wrote:
>
> In a social network, I keep who_has_blocked_me in session vars so that
> their people searches don't display people that have blocked me.
>
> However if the blocked person is logged on at same time that blocker
> person blocks them, the blocked person's session vars will not be current.
>
> Is there a way to detect if someone else besides current user is logged on
> and change their session vars in this type of situation? Or do I have to
> wait until they log on again to re-populate with updated session vars?
>
> Otherwise, I have to check the blocked_people table every time there's a
> people search.
>
How about in the people table, you add a field for "blockingHasChanged".
If that is true, the people search routine goes to check the blocked_people
table and discards the row if that entry shows the searcher is blocked,
otherwise the row is kept.
if row.blockingHasChanged:
if (check_blocked_people == ME):
rows.delete(row)
display_people(row)
>
> thanks
>
> Alex Glaros
>
/dps
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.