PiRSquared17 / msnp-sharp

Automatically exported from code.google.com/p/msnp-sharp
0 stars 0 forks source link

Messages Don't Actually get Sent #198

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Create a new Visual Studio C# .NET Console Application
2. Reference a MSNPSharp DLL 
3. Use the code given at http://petio.org/2010/06/17/msnp.html.  
4. The program will attempt to log in with Credentials("USERNAME", "PASSWORD"), 
replace these with a real account's credentials.
5. The program will attempt to send a message to 
ContactList.GetContact("TARGET-USERNAME"), replace this with an account you  
can listen for messages on.

What is the expected output? What do you see instead?

I expect the program to log on to USERNAME and then send a message to 
TARGET-USERNAME with the text "Hiiii!!!!!!!!!!!!!!!!".
Instead, the program logs on to USERNAME as expected, but I don't get a message 
sent to me at TARGET-USERNAME.  

What version of the product are you using? (MSNPSharp, OS, Mono etc.)

I tried this with MSNPSharp versions 3.1.2 Beta, 3.0.2, as well as latest SVN 
(revision 1616).  Same results.
Operating system is Windows 7 Enterprise.
Compiled using Visual Studio 2010 Premium, as a Visual Studio C# .NET Console 
Application.

Is your code check out from SVN or download from our download site?

I tried both.

Please provide any additional information below:

Here's the output of the program:
<pre>
---- Event ConnectionEstablished ----
Connected to 192.168.12.133:53247
---- Event ConnectionEstablished ----
Connected to 192.168.12.133:53248
---- Event SignedIn ----
Signed in as todstevenson@hotmail.com
Sending message to : notfed@gmail.com
Target Status: Offline
---- Event OIMSendCompleted ----
Message sent to notfed@gmail.com
---- Event SignedOff ----
Signed off from todstevenson@hotmail.com. Reason: None.
Done!
</pre>

Why does it think Target status is Offline?  He's not offline, I'm logged into 
MSN as the Target.  I can also see a "User Blahblah Signed In" popup balloon 
when this program logs in and out, so I know it's successfully logging in.

Original issue reported on code.google.com by not...@gmail.com on 17 Jun 2010 at 7:30

GoogleCodeExporter commented 9 years ago
I'm not sure if i'm right but you send an Offline Instant Message.
Why don't you set up a conversation with Target and send a normal message 
through the conversation?

Original comment by freakysm...@gmail.com on 17 Jun 2010 at 8:46

GoogleCodeExporter commented 9 years ago
I'm not sure how to start a conversation, since it fails since it thinks I'm 
offline.

Original comment by not...@gmail.com on 17 Jun 2010 at 9:50

GoogleCodeExporter commented 9 years ago
Is it coming online when you try this (you can check with another messenger)?

static void SignedIn(object sender, EventArgs e)
        {
            handler = sender as NSMessageHandler;
            Console.WriteLine("---- Event SignedIn ---- ");
            Console.WriteLine("Signed in as " + handler.Credentials.Account);
            messenger.Owner.Status = PresenceStatus.Online; // this is the change
            Thread.Sleep(5000);
            signedinevent.Set();
        }

If it is, you can create a new conversation and invite the target and start 
sending messages.

Original comment by freakysm...@gmail.com on 17 Jun 2010 at 10:05

GoogleCodeExporter commented 9 years ago
Nope that didn't change anything. That sets the owner's status to online.  The 
problem is it thinks the *message recipient* is offline.  

Original comment by not...@gmail.com on 17 Jun 2010 at 10:21

GoogleCodeExporter commented 9 years ago
Ah i see. Are both the sender as the receiver on the allowed list? if not you 
can't see the online status and the messages are not send.

Original comment by freakysm...@gmail.com on 17 Jun 2010 at 10:28

GoogleCodeExporter commented 9 years ago
Well, I'm not sure what an AllowedList is, but for messenger.Owner and for the 
recipient Contact:
  Owner.OnAllowedList = False
  Recipient.OnAllowedList = True

Original comment by not...@gmail.com on 17 Jun 2010 at 10:36

GoogleCodeExporter commented 9 years ago
Try to switch the accounts.
So log into MSN with todstevenson@hotmail.com and let your code send with 
notfed@gmail.com

Original comment by freakysm...@gmail.com on 17 Jun 2010 at 10:41

GoogleCodeExporter commented 9 years ago
Thanks, freakysmoker.   I think I have the problem fixed.
I realized I had myself blocked.  Thus I appeared offline.  I don't know WHY I 
had myself blocked, but I did.

Original comment by not...@gmail.com on 17 Jun 2010 at 11:07

GoogleCodeExporter commented 9 years ago
You're welcome.
Glad to see you have fixed the problem.
Good luck with the rest of your application.

Original comment by freakysm...@gmail.com on 17 Jun 2010 at 11:10

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Looks like this is fixed. Please check more closely next time, but thanks 
freakysmoker for helping notfed :)

Original comment by electk...@gmail.com on 18 Jun 2010 at 6:14