Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion send a message to all client when a user leave channel

View parsed - Show only message text

Received: by 10.204.62.7 with SMTP id v7mr254996bkh.8.1246375063154;
        Tue, 30 Jun 2009 08:17:43 -0700 (PDT)
Return-Path: <jan.han...@gmail.com>
Received: from mail-fx0-f214.google.com (mail-fx0-f214.google.com [209.85.220.214])
        by gmr-mx.google.com with ESMTP id 3si6578fgg.15.2009.06.30.08.17.42;
        Tue, 30 Jun 2009 08:17:42 -0700 (PDT)
Received-SPF: pass (google.com: domain of jan.han...@gmail.com designates 209.85.220.214 as permitted sender) client-ip=209.85.220.214;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.han...@gmail.com designates 209.85.220.214 as permitted sender) smtp.mail=jan.han...@gmail.com; dkim=pass (test mode) header...@gmail.com
Received: by fxm10 with SMTP id 10so218689fxm.22
        for <meteorserver@googlegroups.com>; Tue, 30 Jun 2009 08:17:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:mime-version:received:in-reply-to:references
         :date:message-id:subject:from:to:content-type;
        bh=ybMbUbUVjn15g9vH2YxlMG+8TQS4szxioONofI82xI8=;
        b=L9b0EGmQRXlkR9+WyM78yXfDOnygPeQmncr5vx5LeosulKGPsCFAEpKB1UhWzAvI0X
         4R4MY2IW7zZkHVxn/NFAwPGKTVojgs+tVQUDYd1cHZkHdMK2F56vcFNlobVhBGvpy0Z9
         StH+aj7zsCDgem9JiK+6NmKakcxkMW+p1c7kw=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :content-type;
        b=GPzZ8NmUqvd34jRxt18TA+y3DWs7TvxNourss3CeeDSFQbAYzC9VWOsjuVM+nrjfuV
         2yUJsXKxwUQlMy3cFVdJpTuzLmSUWBqzwYkgbF8GcgV6YVeIaAHpEVLTxRfcS9Sb/PVa
         ibZVYz9lqdPTU2d/az+al0cJYT6fBVXBF/N7Y=
Mime-Version: 1.0
Content-Type: multipart/alternative;
	boundary="001636c5a3cbbe1be3046d924eab"
Received: by 10.204.119.129 with SMTP id z1mr8438665bkq.67.1246375060575; Tue, 
	30 Jun 2009 08:17:40 -0700 (PDT)
In-Reply-To: <6369e849-45ea-4db2-b130-0f3a080455fd@l12g2000yqo.googlegroups.com>
References: <6369e849-45ea-4db2-b130-0f3a080455fd@l12g2000yqo.googlegroups.com>
Date: Tue, 30 Jun 2009 17:17:40 +0200
Message-ID: <3aa908f00906300817m784f005dpdbb5a29e0ae65...@mail.gmail.com>
Subject: Re: send a message to all client when a user leave channel
From: =?UTF-8?B?SmFuIEhhbsSNacSN?= <jan.han...@gmail.com>
To: meteorserver@googlegroups.com

--001636c5a3cbbe1be3046d924eab
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi,
define a unload event handler and make a AJAX call to your server, telling
it the client is logging off. And send an updated list of present users
trough a channel.
Just make sure you make a synchronous AJAX request (some browsers do not
allow asynchronous requests in the unload event).

There will still be cases where you will have "zombie" users, because, for
some reason or other, the unload event won't fire.
I solved this so that every client updates it's last seen flag on the serve=
r
every X minutes, and then I made a cron script that runs every X minutes an=
d
removes the "zombie" clients and sends a new list to connected clients.

Hope this helps.

--
Jan Han=C4=8Di=C4=8D
http://hancic.info


On Tue, Jun 30, 2009 at 4:16 PM, rico <ric...@gmail.com> wrote:

>
> Hello :)
>
> I wonder how it could be possible to send a message when a user leave
> the channel.
>
> In the case of a chat example, when a user join the chanel and send
> his first message, all client could see his nickname on a sidelist.
>
> But when this user leave the channel, how can we tell all subscribers
> to remove this nickname in this sidelist ?
>
>
> thanks by advance for response
>
> rico
> >
>

--001636c5a3cbbe1be3046d924eab
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi,<div><br></div><div>define a unload event handler and make a AJAX call t=
o your server, telling it the client is logging off. And send an updated li=
st of present users trough a channel.</div><div>Just make sure you make a=
=C2=A0<font class=3D"Apple-style-span" face=3D"-webkit-sans-serif"><span cl=
ass=3D"Apple-style-span" style=3D"line-height: 19px;">synchronous AJAX requ=
est (some browsers do not allow asynchronous requests in the unload event).=
</span></font></div>
<div><font class=3D"Apple-style-span" face=3D"-webkit-sans-serif"><span cla=
ss=3D"Apple-style-span" style=3D"line-height: 19px;"><br></span></font></di=
v><div><font class=3D"Apple-style-span" face=3D"-webkit-sans-serif"><span c=
lass=3D"Apple-style-span" style=3D"line-height: 19px;">There will still be =
cases where you will have &quot;zombie&quot; users,=C2=A0because, for some =
reason or other, the unload event won&#39;t fire.</span></font></div>
<div><font class=3D"Apple-style-span" face=3D"-webkit-sans-serif"><span cla=
ss=3D"Apple-style-span" style=3D"line-height: 19px; ">I solved this so that=
 every client updates it&#39;s last seen flag on the server every X minutes=
, and then I made a cron script that runs every X minutes and removes the &=
quot;zombie&quot; clients and sends a new list to connected clients.</span>=
</font></div>
<div><font class=3D"Apple-style-span" face=3D"-webkit-sans-serif"><span cla=
ss=3D"Apple-style-span" style=3D"line-height: 19px;"><br></span></font></di=
v><div><font class=3D"Apple-style-span" face=3D"-webkit-sans-serif"><span c=
lass=3D"Apple-style-span" style=3D"line-height: 19px;">Hope this helps.</sp=
an></font></div>
<div><br clear=3D"all">--<br>Jan Han=C4=8Di=C4=8D<br><a href=3D"http://hanc=
ic.info">http://hancic.info</a><br>
<br><br><div class=3D"gmail_quote">On Tue, Jun 30, 2009 at 4:16 PM, rico <s=
pan dir=3D"ltr">&lt;<a href=3D"mailto:ric...@gmail.com">ric...@gmail.com</a=
>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 =
0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Hello :)<br>
<br>
I wonder how it could be possible to send a message when a user leave<br>
the channel.<br>
<br>
In the case of a chat example, when a user join the chanel and send<br>
his first message, all client could see his nickname on a sidelist.<br>
<br>
But when this user leave the channel, how can we tell all subscribers<br>
to remove this nickname in this sidelist ?<br>
<br>
<br>
thanks by advance for response<br>
<font color=3D"#888888"><br>
rico<br>
<br>
</font></blockquote></div><br></div>

--001636c5a3cbbe1be3046d924eab--


Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google