Просмотр исходного кода

remove PD service

it doesn't appear to be needed by AIM 4.8/5.x
Mike 2 лет назад
Родитель
Сommit
7b24e25eec
3 измененных файлов с 2 добавлено и 63 удалено
  1. 2 2
      server/oservice.go
  2. 0 59
      server/pd.go
  3. 0 2
      server/protocol.go

+ 2 - 2
server/oservice.go

@@ -103,7 +103,7 @@ func (s OServiceService) WriteOServiceHostOnline(w io.Writer, sequence *uint32)
 		SubGroup:  oscar.OServiceHostOnline,
 	}
 	snacPayloadOut := oscar.SNAC_0x01_0x03_OServiceHostOnline{
-		FoodGroups: []uint16{0x0001, 0x0002, 0x0003, 0x0004, 0x0009, 0x0013, 0x000D},
+		FoodGroups: []uint16{0x0001, 0x0002, 0x0003, 0x0004, 0x0013, 0x000D},
 	}
 	return writeOutSNAC(oscar.SnacFrame{}, snacFrameOut, snacPayloadOut, sequence, w)
 }
@@ -339,7 +339,7 @@ func (s OServiceServiceForChat) WriteOServiceHostOnline(w io.Writer, sequence *u
 		SubGroup:  oscar.OServiceHostOnline,
 	}
 	snacPayloadOut := oscar.SNAC_0x01_0x03_OServiceHostOnline{
-		FoodGroups: []uint16{0x0001, 0x0002, 0x0003, 0x0004, 0x0009, 0x0013, 0x000D, 0x000E},
+		FoodGroups: []uint16{0x0001, 0x0002, 0x0003, 0x0004, 0x0013, 0x000D, 0x000E},
 	}
 	return writeOutSNAC(oscar.SnacFrame{}, snacFrameOut, snacPayloadOut, sequence, w)
 }

+ 0 - 59
server/pd.go

@@ -1,59 +0,0 @@
-package server
-
-import (
-	"fmt"
-	"github.com/mkaminski/goaim/oscar"
-	"io"
-)
-
-const (
-	PDErr                      uint16 = 0x0001
-	PDRightsQuery                     = 0x0002
-	PDRightsReply                     = 0x0003
-	PDSetGroupPermitMask              = 0x0004
-	PDAddPermListEntries              = 0x0005
-	PDDelPermListEntries              = 0x0006
-	PDAddDenyListEntries              = 0x0007
-	PDDelDenyListEntries              = 0x0008
-	PDBosErr                          = 0x0009
-	PDAddTempPermitListEntries        = 0x000A
-	PDDelTempPermitListEntries        = 0x000B
-)
-
-func routePD(snac oscar.SnacFrame, r io.Reader, w io.Writer, sequence *uint32) error {
-	switch snac.SubGroup {
-	case PDRightsQuery:
-		return SendAndReceivePDRightsQuery(snac, r, w, sequence)
-	default:
-		return ErrUnsupportedSubGroup
-	}
-}
-
-func SendAndReceivePDRightsQuery(snac oscar.SnacFrame, _ io.Reader, w io.Writer, sequence *uint32) error {
-	fmt.Printf("sendAndReceivePDRightsQuery read SNAC frame: %+v\n", snac)
-
-	snacFrameOut := oscar.SnacFrame{
-		FoodGroup: PD,
-		SubGroup:  PDRightsReply,
-	}
-	snacPayloadOut := oscar.SNAC_0x09_0x03_PDRightsReply{
-		TLVRestBlock: oscar.TLVRestBlock{
-			TLVList: oscar.TLVList{
-				{
-					TType: 0x01,
-					Val:   uint16(100),
-				},
-				{
-					TType: 0x02,
-					Val:   uint16(100),
-				},
-				{
-					TType: 0x03,
-					Val:   uint16(100),
-				},
-			},
-		},
-	}
-
-	return writeOutSNAC(snac, snacFrameOut, snacPayloadOut, sequence, w)
-}

+ 0 - 2
server/protocol.go

@@ -346,8 +346,6 @@ func (rt *Router) routeIncomingRequests(cfg Config, sm SessionManager, sess *Ses
 		return routeBuddy(snac, buf, rw, sequence)
 	case ICBM:
 		return rt.RouteICBM(sm, fm, sess, snac, buf, rw, sequence)
-	case PD:
-		return routePD(snac, buf, rw, sequence)
 	case CHAT_NAV:
 		return rt.RouteChatNav(sess, cr, snac, buf, rw, sequence)
 	case FEEDBAG: