Examples of PurpleInterface


Examples of im.pidgin.purple.PurpleInterface

  public static void main(String[] args) throws DBusException {
    //ReceivingImMsg_Handler ringh = new ReceivingImMsg_Handler();
    //ReceivedImMsg_Handler rdh = new ReceivedImMsg_Handler();
   
    DBusConnection conn = DBusConnection.getConnection(DBusConnection.SESSION);
    PurpleInterface po = (PurpleInterface)conn.getRemoteObject("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject");
    FileHandler fh = new FileHandler(po,conn, "agent_file_", ".tmp");
    //conn.addSigHandler(im.pidgin.purple.PurpleInterface.FileSendStart.class, fh);
    //conn.addSigHandler(im.pidgin.purple.PurpleInterface.FileSendComplete.class, fh);
   
    byte[] orgArr = new byte[]{'c','d','w','h','d','l'};
    String path = fh.packInFile(orgArr);
    byte[] bar = fh.unpackFromFile(path);
   
    for (int i=0;i<bar.length;i++)
    {
      assert(bar[i]==orgArr[i]);
    }
    //Handle system messages, they should not pop for the user
    //conn.addSigHandler(im.pidgin.purple.PurpleInterface.ReceivingImMsg.class, ringh); 
    //conn.addSigHandler(im.pidgin.purple.PurpleInterface.ReceivedImMsg.class, rdh);
   
    List<Integer> li = po.PurpleAccountsGetAll();
    for(int i = 0; i<li.size(); i++)
    {
      System.out.println(li.get(i));
    }
   
    //------------------------File Operations-----------------------------
   
    //Get a list of all connections
    List<Integer> licon = po.PurpleConnectionsGetAll();
    System.out.println("---------Connections----------");
    for(int i = 0; i<licon.size(); i++)
    {
      System.out.println(licon.get(i));
    }
View Full Code Here

Examples of im.pidgin.purple.PurpleInterface

  public void handle(ReceivedImMsg sig) {
    PurpleInterface.ReceivedImMsg rsig = (PurpleInterface.ReceivedImMsg) sig;
    System.out.println("Caught a ReceivedImMsg signal!");
    try {
    DBusConnection conn = DBusConnection.getConnection(DBusConnection.SESSION);
    PurpleInterface po = (PurpleInterface)conn.getRemoteObject("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject");
    String al = po.PurpleBuddyGetAlias(po.PurpleFindBuddy(rsig.a, rsig.b));
   
    po.PurpleConvImSendWithFlags(po.PurpleConversationGetImData(sig.d), "can you read this dear Christoph?", 0x8000);
   
    System.out.println("Wrote invisible");
    while (true)
    {
   
View Full Code Here

Examples of im.pidgin.purple.PurpleInterface

    System.out.println("Caught a ReceivingImMsg signal!");
    //sig.c="hanihani";
    DBusConnection conn;
    try {
      conn = DBusConnection.getConnection(DBusConnection.SESSION);
      PurpleInterface po = (PurpleInterface)conn.getRemoteObject("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject");
      System.out.println("The message is:" + sig.c);
      //po.PurpleConversationDestroy(sig.d);
      this.temp+= sig.c;
      //byte[] decoded = Base64.decodeBase64(this.temp.getBytes());
     
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.