msnp11-sdk 0.3.1

An MSNP11 client SDK
Documentation
msnp11-sdk-0.3.1 has been yanked.

An MSNP11 client SDK. Still a WIP, but messaging and some contact actions have tests that confirm they're working.

Login

use msnp11_sdk::client::Client;
use msnp11_sdk::enums::event::Event;
use msnp11_sdk::models::personal_message::PersonalMessage;
use msnp11_sdk::enums::msnp_status::MsnpStatus;

let mut client = Client::new("127.0.0.1".to_string(), "1863".to_string())
   .await
   .unwrap();

client.add_event_handler_closure(|event| { /* Handle events... */ });

// Handle a redirection by creating a new connection
if let Ok(Event::RedirectedTo { server, port }) = client
    .login(
        "testing@example.com".to_string(),
        "123456".to_string(),
        "http://localhost:3000/rdr/pprdr.asp".to_string(),
    )
    .await
 {
    client = Client::new(server, port).await.unwrap();
    client
        .login(
            "testing@example.com".to_string(),
            "123456".to_string(),
            "http://localhost:3000/rdr/pprdr.asp".to_string(),
        )
        .await
        .unwrap();
 }

client.set_presence(MsnpStatus::Online).await.unwrap();
client
    .set_personal_message(&PersonalMessage {
        psm: "test".to_string(),
        current_media: "".to_string(),
    })
    .await
    .unwrap();

Bindings

Bindings for Kotlin and Swift can be generated with UniFFI.