ok Karel, I just saw one of your commits :
                if {$has_new == "true" } {
+                                                               
::abook::setVolatileData $email space_updated 1
+                                                               
::Event::fireEvent contactSpaceChange protocol 
$email
+                                                       } else {
+#FIXME:                                                                #this 
line might not be needed
+                                                               
::abook::setVolatileData $email space_updated 0
+                                                       }
+
                                                }
this here, the 'else' should have the same event fired because we might call 
this function to refresh the blog 
info and we need to update the space_updated variable AND contactSpaceChange, 
there's no reason for us not to do 
it.
What we could do though is :
if { $has_new != [abook::getVolatileData $email space_updated ""] } {
  set fireevent 1
} else {
  set fireevent 0
}

...
if {$fireevent } { ::event::fireEvent .. .. }



Then I saw this code here :

        method handleNOT { command payload } {
                #save the spaces notification here
                set contact [lindex $command 1]
-               status_log "got spaces notification for $contact"
+               status_log "got spaces notification for $contact ($command)"
+               ::abook::setVolatileData $email space_updated 1
+               ::Event::fireEvent contactSpaceChange protocol $contact
        }

I know the previous code wasn't very easy but it's wrong, the $contact is SO 
not the real contact lol..
actually, to get the contact name, we need to parse the xml received, get the 
<BODY> tag, which is itself 
another XML (so change all &lt; and &gt; to < and >) then parse that XML to get 
the CID then from the CID you 
can get the user's email.
I think the best is that, on a notification, we just go and call InitCCard 
again (which is why I said earlier we 
need to fire the event, don't assume it's always gonna be 0 by default)

KKRT


On Sat, Jan 13, 2007 at 12:59:48PM -0500, Youness Alaoui wrote:
> ok.. NWM, this is speculation :p 
> actually, when you access someone's spaces, or when a new item is posted, you 
> receive a notification (via the 
> NOT command), search for this line :
> protocol.tcl:           status_log "got spaces notification for $contact"
> you'll find where it is received.. the <BODY> of the notification is an xml 
> similar to the one that we first 
> receive to get the last modification date, the resource id and whether there 
> is a new item in the spaces or not. 
> So I suppose that once you open someone's ccard, when we fetch that 
> information from the server, we'll receive a 
> NOT notification that tells us that we have no more new item 
> (<HasNewItem>false</HasNewItem>) that's when we 
> remove the star.
> Actually, on that 'NOT' notification, we should update the 
> ::abook::getVolatileData $email space_updated, then 
> send the event about the spaces info having changed, and the CL should 
> automatically either add or delete the 
> star depending on what the notification contained (if someone updated his 
> blog we get a notification this way 
> too).
> that's about it! :)
> 
> KKRT
> 
> On Sat, Jan 13, 2007 at 12:34:17PM +0100, NoWhereMan wrote:
> > 
> > ----- Original Message ----- 
> > From: "Karel Demeyer" <[EMAIL PROTECTED]>
> > To: "Mailing list for developers and everyone helping AMSN" 
> > <amsn-devel@lists.sourceforge.net>
> > Sent: Saturday, January 13, 2007 11:57 AM
> > Subject: Re: [Amsn-devel] Contact Cards and MSN spaces
> > 
> > 
> > >I just implemented an Event for a changed space.  Now, I was asking
> > > myself ... how do we know when we can unset the star's appearance ?
> > > When do we know the blog is read ?  When our user clicks the star ?
> > > Doesn't the protocol let us know when the blog has no unread items or
> > > unseen photos ?
> > >
> > > Karel.
> > 
> > in MSN7.5 gleam disappears when you click to see the ccard, so I guess that 
> > once you clicked you can set a local variable read($user) to 1;
> > gleams are client-side, so if you set a space to read on a client if you 
> > log 
> > in from another pc you should still see blinking gleams.
> > 
> > about the ccard embedded in CL... I don't know, it would be too 
> > "compressed"... how about an in-CL ccard ?
> > http://i18.tinypic.com/2e5mg02.png
> > 
> > with a "< back" link to the main cl... I don't know maybe it's even worse 
> > than the msn-style ccards :P
> > 
> > bye 
> > 
> > 
> > -------------------------------------------------------------------------
> > Take Surveys. Earn Cash. Influence the Future of IT
> > Join SourceForge.net's Techsay panel and you'll get the chance to share your
> > opinions on IT & business topics through brief surveys - and earn cash
> > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > _______________________________________________
> > Amsn-devel mailing list
> > Amsn-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/amsn-devel
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Amsn-devel mailing list
> Amsn-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amsn-devel

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Amsn-devel mailing list
Amsn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amsn-devel

Reply via email to