aMSN Forums
June 20, 2013, 11:23:23 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: New forum for aMSN !!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Canceling webcam invites  (Read 15921 times)
Grunty
Newbie

Offline Offline

Posts: 24


View Profile
« on: March 03, 2007, 06:46:48 pm »

Hi,
I have added support for canceling webcam invites for the SVN version.

Files changed:
msnp2p.tcl
msncam.tcl

Patches:
msnp2p.patch - patch to be applied to msnp2p.tcl  http://www.savefile.com/files/529713
msncam.patch - patch to be applied to msncam.tcl  http://www.savefile.com/files/530267

Could this be applied to the latest svn?

Thanks,
           Grunty

p.s. I did send a email to amsn-devel@lists.sf.net but i put declining rather than canceling  :oops:
Logged
Grunty
Newbie

Offline Offline

Posts: 24


View Profile
« Reply #1 on: March 03, 2007, 07:08:18 pm »

After some testing it appears that if the other user is using the official msn client then the invite cancels however if they are also using amsn then they can still accept or reject the invite. if they accept they can still connect to the webcam.
hmmmm

Grunty
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #2 on: March 03, 2007, 10:05:37 pm »

Hi Grunty!
Thanks for the contribution, it's indeed an important feature that we forgot to add...
I'll commit your patch, lePhilousophe converted your diff files into a 'standard' diff, otherwise, I couldn't have patched the code.. next time, it would be better (and easier) to just type 'svn diff' to get a very standard patch file.
I made slight modifications, first, you disabled the 'cancel' button in the protocol part AND the gui part, it was only needed in one part, so I removed it from the protocol part.
secondly, the callback was between quotes, it's better to put it between [list ] (avoid any bugs if there's a space in one of the variables). I guess you just copied the syntax from elsewhere in the code.. that proves that the old code was already crap :p
anyways, thanks a lot!!!!
oh and about the official client canceling the cam right away, it was reported once in the ML, but we never heard news about it until you right now, so I tried to reproduce, couldn't... until... well, here's how to reproduce :
send a cam request from amsn. on wlm, dont' accept nor decline it, chat for a while, then from amsn send a second cam request... now wlm will cancel it right away... that's because wlm can only handle one request at a time, so when you're sending two (the one that was never accepted/rejected + the new one), it just cancels the last one, in WLM, we get the message :
Quote
Your request to view your contact's webcam was declined because <NICKNAME> sent you an invitation to view his or her webcam at the same time. Please cancel any pending webcam invitations and ask your contact to resend the invitation

can you confirm that this is how it happened ?
anyways, your patch works great so thanks a lot for the contribution!
Logged

KaKaRoTo
Grunty
Newbie

Offline Offline

Posts: 24


View Profile
« Reply #3 on: March 04, 2007, 01:37:19 pm »

No probs about the patch, it was a feature that i had always wanted Smiley and sorry about them being in the wrong format i haven't really participated in many open source projects.

Quote
can you confirm that this is how it happened ?

Unfortunately i was unable to reproduce, but i am using msn 7.0 through wine i will try WLM later

Il make my post above a bit clearer and how to reproduce:-
2 aMSN clients with the patches (haven't tried without the patch)
Client 1 - sends a web cam invite and cancels
Client 2 - receives the invite and a notification that it has be canceled however the Accept and Decline buttons are still accessible and if the user clicks on accept they can still view the web cam although it has been canceled
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #4 on: March 04, 2007, 09:24:17 pm »

ouch, lol, that's bad!!! Cheesy
I'll try to fix it Smiley
thanks for noticing
Logged

KaKaRoTo
Grunty
Newbie

Offline Offline

Posts: 24


View Profile
« Reply #5 on: March 05, 2007, 10:28:51 pm »

Little update,
If a WLM contact invites you to a webcam session and they cancel it the accept/decline buttons are still usable however you cannot connect so i guess some code has to be implimented to disable these buttons after a cancel
Logged
Grunty
Newbie

Offline Offline

Posts: 24


View Profile
« Reply #6 on: March 05, 2007, 10:46:42 pm »

I just realised how easy it is to add the functionality.
patch here > http://www.savefile.com/files/534460
(using svn diff Tongue)
this patch basically disables the Accept / Decline buttons when the webcam is canceled you may want to clean up the code cause i did it rather quickly, and i dunno what bugs my code may create. Saying that the code is simple and should be bullet proof.

Thanks,
Grunty
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #7 on: March 06, 2007, 12:33:40 am »

Thanks again Grunty for your help, you fixed it the easy way, I was hoping to actually fix it so that even if someone with an older amsn version accepts it amsn will reject it... I'll look into it later.. for now, I committed your patch.. I'll test it later...
thanks again!
Logged

KaKaRoTo
Grunty
Newbie

Offline Offline

Posts: 24


View Profile
« Reply #8 on: March 06, 2007, 08:09:47 pm »

Here is the patch for preventing a older amsn user to view web cam:

http://www.filefactory.com/file/c700fe/

The code i added is when you cancel your web cam it adds "webcamcanceled" to the 7th field of the session list.
if a invite is accepted or rejected, it checks if the invite has been canceled it returns 0 if it has been canceled.
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #9 on: March 29, 2007, 04:23:56 am »

Hi Grunty, I finally wanted to look at your patch but I couldn't get it.. in the link you gave me (http://www.filefactory.com/file/c700fe/) it says :
Quote
Sorry, this file is no longer available. It may have been deleted by the uploader, or has expired.
...
so, would you mind sending it again please ? you can paste its content in here, I don't mind...
Thanks again and sorry for the delay...
Logged

KaKaRoTo
Grunty
Newbie

Offline Offline

Posts: 24


View Profile
« Reply #10 on: April 14, 2007, 11:11:23 pm »

Soz for my late reply :S

I will post the data in here ( revision number is wrong) :

Index: msncam.tcl
===================================================================
--- msncam.tcl  (revision 8167)
+++ msncam.tcl  (working copy)
@@ -166,7 +166,7 @@
                }

                CamCanceled $chatid $sid
-
+               ::MSNP2P::SessionList set $sid [list -1 -1 -1 -1 -1 -1 -1 "webcamcanceled" -1 -1]
                #::MSNP2P::SessionList unset $sid
        }

@@ -438,8 +438,9 @@
        }

        proc answerCamInvite { sid chatid branchid } {
-
-
+               if { [lindex [::MSNP2P::SessionList get $sid] 7] == "webcamcanceled"  } {
+                       return 0
+               }
                ::MSNP2P::SessionList set $sid [list -1 -1 -1 -1 -1 -1 -1 -1 -1 "$branchid" ]
                set session [::MSNP2P::SessionList get $sid]
                set dest [lindex $session 3]
@@ -2167,7 +2168,6 @@
        }
        #Executed when we receive a request to accept or refuse a webcam session
        proc AcceptOrRefuseWrapped {chatid dest branchuid cseq uid sid producer} {
-
                #Grey line
                ::amsn::WinWrite $chatid "\n" green
                ::amsn::WinWriteIcon $chatid greyline 3
@@ -2268,6 +2268,7 @@
                        return 0
                }

+
                #Disable items in the chatwindow
                [::ChatWindow::GetOutText ${win_name}] tag configure acceptwebcam$sid \
                        -foreground #808080 -font bplainf -underline false
@@ -2322,6 +2323,9 @@

        #Executed when you invite someone to a webcam session and he refuses the request
        proc InvitationDeclined {chatid sid} {
+               if { [lindex [::MSNP2P::SessionList get $sid] 7] == "webcamcanceled"  } {
+                       return 0
+               }
                SendMessageFIFO [list ::CAMGUI::InvitationDeclinedWrapped $chatid $sid] "::amsn::messages_stack($chatid)" "::amsn::messages_flushing($chatid)"
        }
        proc InvitationDeclinedWrapped {chatid sid} {
@@ -2329,7 +2333,7 @@
                if { [::ChatWindow::For $chatid] == 0 } {
                        return 0
                }
-
+
                [::ChatWindow::GetOutText ${win_name}] tag configure cancelwebcam$sid \
                    -foreground #808080 -font bplainf -underline false
                [::ChatWindow::GetOutText ${win_name}] tag bind cancelwebcam$sid <Enter> ""
@@ -2352,7 +2356,7 @@
                if { [::ChatWindow::For $chatid] == 0 } {
                        return 0
                }
-
+               # Cancel Button
                # Disabling Cancel Button
                [::ChatWindow::GetOutText ${win_name}] tag configure cancelwebcam$sid \
                    -foreground #808080 -font bplainf -underline false
Logged
amsn_fan
Newbie

Offline Offline

Posts: 38


View Profile
« Reply #11 on: April 16, 2007, 06:32:11 pm »

When I get a webcam receive invite, it often says its cancelled before it appears. Im not sure why this occurs.
I will investigate further who initiates it etc and what messages I get.

Also in the window by the red stop button, rather than "stop receiving webcam" it says "stop sending webcam"
Logged
Grunty
Newbie

Offline Offline

Posts: 24


View Profile
« Reply #12 on: April 17, 2007, 05:37:35 pm »

What version are you using? and it may be help to post in your own thread:P
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!